Phpcms notes, phpcms

Source: Internet
Author: User

Phpcms notes, phpcms

The first step is to divide the home page into three parts: the navigation part, the tail part, and the middle part of the home page use three different files header.html; index.html; footer.html

Before using phpcms, you must first put the css, js, and img of the webpage into the corresponding folder in the statics folder. Then, create a folder in the template folder and put it in header.html; index.html; footer.html.

After dividing the homepage of a website into three parts, the first thing to do is to change the path to {CSS_PATH} + Put css file name; {JS_PATH} + Put js file name;

{IMG_PATH} + name of the image folder to be added; after modification, the webpage will be displayed normally.

We use phpcms to set static web pages to dynamic, so the pictures in them can be changed.

The navigation part is changed:

1 {if $ top_parentid = 0} 2 <! -- Determine whether the homepage is displayed. If the homepage is displayed, add the select option, that is, the color changes. --> 3 <a href = "{siteurl ($ siteid )} "> 4 <div class =" h-item select "> homepage </div> 5 </a> 6 {else} 7 <a href =" {siteurl ($ siteid)} "> 8 <div class =" h-item "> homepage </div> 9 </a> 10 {/if} 11 <! -- The following are other options in the navigation except the Home Page. 6 of them do not contain the home page --> 12 {pc: content action = "category" catid = "0" num = "6" siteid = "$ siteid" order = "listorder ASC"} 13 {loop $ data $ r} 14 {if $ catid = $ r [catid] | $ top_parentid = $ r [catid]} 15 <div class = "h-item2">/</div> 16 <a href = "{$ r [url]}"> 17 <div class = "h-item select" >{$ r [catname]} </div> 18 </a> 19 {else}
<div class="h-item2">/</div>
<a href="{$r[url]}">
<div class="h-item">{$r[catname]}</div>
</a>
{/if}
{/loop}
{/pc}

 

After changing to the navigation bar, it is the big chart of the Home Page. To replace the big chart, you must first create a new topic: Content-manage topic-add topic to add a big chart, and cannot display it in the navigation bar.

Then, find the big image in the management content, add the content, and add the thumbnail.

{Pc: content action = "lists" catid = "9" order = "id DESC" num = "1"} {loop $ data $ val}  <! -- Thumb indicates the thumbnail --> <! -- Catid refers to the content under the topic. I put the image in the position of 9, so catid = "9" --> {/loop} {/pc}

Click images to link to the web page

For example:

<Div class = "three-item"> <! -- 13 indicates the topic code --> <a href = "{$ CATEGORYS [13] [url]}">  </a> </div> <div class = "three-item"> <a href = "{$ CATEGORYS [11] [url]}">  </a> </div> <div class =" three-item "> <a href =" {$ CATEGORYS [12] [url ]} ">  </a> </div>

Below are the changes to the list:

<! -- Title -->

<Div class = "dt-title">
<Span class = "dt-sp1"> {$ CATEGORYS [14] [catname]} </span> <a href = "{$ CATEGORYS [14] [url]}"> <span class = "dt-sp2" style = "color: white; "> More >></span> </a> </div> <! -- Display item --> {pc: content action = "lists" catid = "14" order = "id DESC" num = "4" }{ loop $ data $ val} <div class = "dt-item"> <a href = "{$ val [url]}"> <div class = "dt-item-title"> {$ val [title]} </div> </> <div class = "dt-item-context" >{$ val [description] }</div> </div >{/ loop }{/pc}

 

 


 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.