Using PHPCMS to create an enterprise station, you first replace the static Enterprise homepage with a dynamic home page that can be edited in the background.
Create a new English folder in Phpcms/install_package/phpcms/templates
Under this folder, create a content folder
Modify the. HTML Web page file to make the file name index.html and put it in the content folder
Then open the Phpcms background interface, click the interface, enable your own home folder
Finally click on the settings, enter the site management, click the site behind the changes
First step: First make a static Enterprise station homepage:
<! DOCTYPE html>02The second step: the JS and CSS in the Web page to the JS and CSS files into the Statics folder in the corresponding location.
and modify the file address according to the following format:
How to replace:
{Css_path} represents the CSS storage path defined by the CMS
{Js_path} represents the JS storage path defined by the CMS
{Img_path} represents the picture storage path defined by the CMS
Step three: Set up the template to use
Change the default template in Phpcms to the template you made.
Create a new English folder in Phpcms/install_package/phpcms/templates
Under this folder, create a content folder
Modify the. HTML Web page file to make the file name index.html and put it in the content folder
Login Phpcms background, you can see the interface-"template style will show the newly added template
Settings-"Site management Select the template style, click OK."
Update cache, generate home page after
When you click on the site homepage you will see that the template changes successfully:
Fourth step: Split template
Split the template into head code, content code, tail code
Newly created as header.html footer.html content part remains in index.html
Add the code {Template "content", "header"} to the index.html header to import the header.html
Add the code {Template "Content", "footer"} to the index.html tail to import the footer.html
Fifth Step: Add columns
In the header.html
Put the static web page
<title></title>
Switch
<title>{if isset ($SEO [' title ']) &&!empty ($SEO [' title '])} {$SEO [' title ']}{/if}{$SEO [' Site_title ']} </title>
Two more <meta> tags are introduced below
<meta name= "keywords" content= "{$SEO [' keyword ']}" ><meta name= "description" content= "{$SEO [' description ']} ">
Add a link to the navigation bar: according to the background of the column
Will
<ul>2 <li ><a class= "col" href= "" > Home </a></li>3 <li ><a class= "base" Href= "" > News </a></li>4 <li ><a class= "base" href= "" > Announcements </a></li>5 <li ><a class= "base" href= "" > About us </a></li>6 <li ><a class= "base" href= "> Join us </a></li>7 </ul>
To be replaced by:
<div id= "header" >02 <ul>03 {if $top _parentid==0}<!--determine if the home page is displayed-->04 <li><a href= "{SiteURL ($siteid)}" class= "col" > Home </a></li> <!--If it is the first page, add a property font to the home page to display white. --{else}06 <li><a href= "{SiteURL ($siteid)}" > Home </a></li><!--if not Home, content normal display. -->07 {/if}08 {pc:content action= "category" catid= "0" num= "5" siteid= "$siteid" order= "Listorder A SC "}09 {if $catid = = $r [catid] | | $top _parentid== $r [catid]}<!--Judging the catid shown, if it is displayed catid-->10 <l I><a href= "{$r [url]}" class= "col" >{$r [catname]}</a></li><!--plus attribute, font display white-->11 {else}12 <li><a href= "{$r [url]}" class= "base" >{$r [catname]}</a></li><!--If it is not displayed, the content is displayed correctly- {/if}14 {/pc}15 </ul> </div>
Explanation of {pc:content action= "category" catid= "0" num= "5" siteid= "$siteid" order= "Listorder ASC"}:
PC (abbreviated by PHPCMS) category is the meaning of the column,
CATID is the column ID, the default is 0,catid=0 the background of all the first-level columns, catid=1 represents a 1 of the first-class column of all columns;
Num is the maximum number of columns; siteid= "$siteid" stands for the site id;order= "Listorder ASC" means Listorder ascending, Listorder is the order in which columns are added;
{Loop $data $r} {/loop} is equivalent to a foreach loop, $data is the data that is traversed in the background, and is a two-dimensional array, $r is an array of two-dimensional array traversal, $r [CatName] is the column name, $r [url] is the column link to the address
Show only first page
Add Column:
In the Phpcms backstage, the Content-"management column to add columns
Add the columns you want to add, and note that the templates in the template settings are modified to the current template.
Sixth step: Add content to the column
Implementation of dynamic content in the following four Div
Modify the code for index.html
First, add internal links to more:
Code:
<a href= "{$CATEGORYS [10][url]}" > More </a>
The median number represents the column code in the Phpcms backstage.
To set the content of the div dynamic:
<div class= "List" >2 news <span style= "padding-left:430px;" ><a href= "{$CATEGORYS [10][url]}" > more </a></span>3 {pc:content action= "lists" catid= "num" = "1" siteid= "$siteid" order= "id DESC"}4 {loop $data $r $val}5 <p><a href= "{$val [url]}" >{$val [ Title]}</a></p>6 <p>{$val [description]}</p>7 {/loop}8 {/pc}9 </div >
Explanation for {pc:content action= "lists" catid= "num=" 1 "siteid=" $siteid "order=" ID DESC "}
action= "Lists" represents the list content you are looking for
action= "category" representative search column
{Loop $data $r $val} {/loop} loop through the contents of the Content list, take the title of $val[title], take the content $val[description], take the picture with $val[thumb];
Catid= "10" is the representative of the column ID 10 under the column of all content, equivalent to find its parent
The tail footer.html is also traversed with the same method as the head;
Replace list pages and content pages
After home replacement is complete
Next Replace list page
First put the static page of the list into the content folder of the corresponding template, and renamed to List.html
and select one of the following when creating a column
In the same way, the header and tail are removed, using {Template "content", "headers"} and {Template "content", "footer"} to import the Kinsoku file.
If there is a separate CSS or JS file, also use {Css_path} with {Js_path} to modify the path, while the image path with {Img_path}
If you use a list style for a different style:
Also create an HTML file at the beginning of the list and place it under the content folder
Modify the column template
Also to turn tail, import CSS and JS file, and modify the path
If there's a column with a two level column set
Level Two column template is set to:
A list page with a new category.html of level two is now created.
Remove Kinsoku, import files, modify paths
Introduced in secondary navigation:
12345678910 |
{pc:content action="category" catid="$catid" order="listorder ASC" num="10" siteid="$siteid"}
{loop $data $v}
代码
{/loop}
{/pc}
|
To show the level two column.
After clicking on the two-level column link, the page links to the list_renci.html page
At this point, add the list_renci.html in level two navigation:
12345678910 |
{pc:content action="category" catid="$parentid" order="listorder ASC" num="10" siteid="$siteid"}
{loop $data $v}
代码
{/loop}
{/pc}
|
To show the parent column, which is all level two columns.
In the content page, the new show.html file is put into the content page, and the same goes to the tail, the import file, and the path modification.
If the page is to be linked to another page, modify the link to the content:
Note: The link is the address in the Wamp directory that begins with localhost.
PHPCMS Replace class list page, content page, home page