This article describes the instructions for using template labels in phpcms v9. {Template "content", "header"} calls the root directory under the Phpcms\template\content\header file {CHARSET} character set (GBK or Utf-8) {if isset ($SEO [' title ']) &&!empty ($SEO [' title ']} {$SEO [' title ']}{/if}{$SEO [' Site_title ']}{$SEO [' keyword ']}{$SEO [' Description ']} title and title SEO optimization {css_path} address replace with root directory under \statics\css{js_path} address replaced by root directory \statics\js{pc:content action= "position" posid= "9" order= "id" num= "cache=" 3600 "}pc tag {pc:content parameter name =" parameter value "parameter name =" parameter value "parameter name =" parameter value "}{loop $data $k $v} {$v [Title]}{/loop} PC Tag Value action= "Position"--------------dialog box type = "Content Recommendation List" posid= "9"----------------------recommended bit id= "9" order= "id"-------- -------------Sort type = "id" num= "ten"----------------------number of data calls = "cache=" 3600 "-------------------cache =" 3600 "milliseconds {get_ SiteID ()}{img_path}action= "hits" ranking, hotspots and other action= "lists" mainly used for lists and so on. Catid= "$catid" The current column ID specifies a number, that is, the number of num= "" Calls to the specified column order= "id desc" in descending order by ID order= "ID ASC" in ascending order by id "views DESC" sort= "" "1" Thumbnail return= "" page= "$page" need to be paged whenever a few lines of the list appear this {if $num%2==0} {/if} loop label {loop $data $r} {/loop}{loop $info $r} {/loop} Date-------------{date (' y-m-d h:i:s ', $r [inputtime]} article link------{$r [url]} article title------{$r [title]} title intercepts------{str_cut ($r [title],40, ' } thumbnail---------loop is info when {thumb ($r [thumb],110,0)} loop is data with {thumb ($v [thumb],90,0)} tab tag------{$pages} Article page label title-------{$title} content-------{$content} date-------{$inputtime} source-------{$copyfrom} Click------site Home----------------{siteurl ($siteid)} Current location----------------{catpos ($catid)} column name----------------{$CAT [ CatName]} column Pinyin----------------{$CAT [letter]} column link----------------{$CAT [url]} parent column name--------------{$CATEGORYS [$CAT [ Parentid]][catname]} parent Column link--------------{$CATEGORYS [$CAT [Parentid]][url]} Upper column name--------{$CATEGORYS [$CATEGORYS [ $CAT [Parentid]][parentid]][catname]} upper Column link--------{$CATEGORYS [$CATEGORYS [$CAT [Parentid]][parentid]][url]} First Level parent column list {pc:content action= "category" catid= "0" num= "siteid=" $siteid "order=" Listorder ASC "}{loop $data $r} {$r [ CATNAME]}{/LOOP}{/PC} Sibling column list {pc:content action= "category" Catid= "$parentid" num= "siteid=" $siteid "order=" Listorder ASC "}{loop $data $r} {$r [CatnamE]}{/LOOP}{/PC} Group list {loop $photos $r}{/loop} Note: Where $photos is a custom group field, {$r [url]} is a picture address {thumb ($r [url], 75, 45,0)} is a picture thumbnail, {$ R[alt]} for the first page of the picture description call 1, V9 simultaneously call multiple columns the latest article tag {pc:get sql= "select ' n '. ' Inputtime ', ' n '. ' url ', ' n '. ' title ', ' C '. ' CatName ', ' C '. ' The URL ' as ' c_url ' from ' v9_news ' as ' n ' leftjoin ' v9_category ' as ' C ' on ' n '. ' CatID ' = ' c '. ' CatID ' where ' c '. ' CatID ' in (6,7,8 , 9,10) Order BY ' n '. ' ID ' desc "num=" "cache=" 3600 "page=" "dbsource=" "return=" Data "}{loop $data $key $val}{date (' Y-m-dh : I:s ', $val [inputtime])}[{$val [catname]}]{$val [Title]}{/loop}{/pc}{pc:get sql= "select * from Anzhi where catid= ' CID '" }{loop $data $r}{/loop}{/pc}2, home page Headlines {pc:content action= "position" posid= "2" order= "Listorderdesc" num= "1"}{loop $data $r }{str_cut ($r [title],20, ')}{str_cut ($r [description],102)}{/LOOP}{/PC} calls 4 {pc:content action= "position" posid= "2" order= "Listorder DESC" num= "4"}{loop $data $r}{str_cut ($r [title],36, ')}{if $n ==1}{/if}{str_cut ($r [description],112 }{/loop}{/pc}3, call a column of the latest article {pc:content action= "lists" catid= "6" order= "ID DESC "num=" cache= "3600"}{loop $data $r} {$r [title]}{/loop}{/pc}4, invoke graphics news {pc:content action= "position" posid= "12" thumb= "1" order= "Listorder DESC" num= "}{loop $data $r}{str_cut ($r [title],20)}{/loop}{/pc}5, external data source calls {Pc:get sql=" SELECT * from Pre_forum_thread "cache=" 3600 "dbsource=" Discuz "return=" Data "num=" 10 "}6, specified variable loop growth (slide call) {Pc:content action= "Position" posid= "1" order= "Listorder DESC" thumb= "1" num= "5"}{loop $data $r}{/loop}{/pc}{pc:content action= " Lists "catid=" "order=" Listorderdesc "thumb=" 1 "num=" 5 "}{php $num = 0}{loop $data $r}linkarr[{$num}] =" {$r [url]} ";p ICA rr[{$num}] = "{$r [thumb]}"; textarr[{$num}] = "{str_cut ($r [title],36, ')}"; {PHP $num + +} {/loop} {/pc}7, call text links {pc:link action= "type_list" siteid= "$siteid" order= "Listorder DESC" num= "return=" Dat}{loop $dat $v } {$v [name]}| {/loop} {/pc}8, call picture link {pc:link action= "type_list" siteid= "$siteid" linktype= "1" order= "Listorder DESC" num= "8" return= "Pic_ Link "}{loop $pic _link $v}/>{/loop}{/pc} II, content page Call Module Name: Description of the available action action name provided by the contents module lists Content Data list relation content related articles hits content data Click the Leaderboard Category Content column list position Content Recommended list position operating instructions are as follows:--------------------------------------------------------------------------------1, Content recommendation List (position): Available parameters: Parameter name must default value description Posid is null recommended bit Idcatid no null call column Idthumb No 0 whether only must thumbnail order no null sort type num is null number According to the number of calls code example: {pc:content action= "position" posid= "2" order= "Listorderdesc" num= "4"}{loop $data $key $val} {$val [' title ']} {/loop} {/PC} returns the following table: field type null default comment title char (80) No null recommended bit header URL Char No null recommended bit link address inputtime int (10) No null recommended bit published time Thumb char is N ULL recommended bit thumbnail other variable Yes The name of the field that is added to the recommendation bit according to the model--------------------------------------------------------------------------------2, Table of Contents (lists): Available parameters: Parameter name must default value description CATID no null call column Idthumb No 0 whether only must thumbnail order no null sort type num is a null data call number code example: {pc:content AC tion= "Lists" catid= "2" order= "id DESC" num= "4"}{loop $data $key $val} {$val [' title ']}{/LOOP}{/PC} The return parameter is as follows: field type null default Note Title char (80) No null recommended bit header URL char no NULL referral bit link address inputtime int (10) No null recommended bit publish time thumb char is null recommended bit thumbnail other indeterminate Is the other model field--------------------------------------------------------------------------------3, click on the leaderboard (hits): Available parameters: Parameter name Whether the default value description must be CATID no null call column Idday no 0 call number of days within the rank order no null sort type (this month-monthviews DESC, this week's ranking-weekviews DESC, today's ranking-Dayvie WS DESC) num is a null data call number code example: {pc:content action= "hits" catid= "2" order= "Weekviewsdesc" num= "ten"}{loop $data $key $val}{$ val[' title ']}{/LOOP}{/PC} returns the following table: field type null default comment title char (80) No null recommended bit header URL Char No null recommended bit link address inputtime int (10) No null push Recommender release time Thumb char is a NULL recommended bit thumbnail other indeterminate is Other model fields-------------------------------------------------------------------------------4, related articles (relation): Available parameters: Parameter name Whether the default value description must be CATID no null call column Idrelation no $relation no need to change keywords no null content page value: $rs [Keywords]num is a null data call number code example: {Pc:conte NT Action= "relation" relation= "$relation" catid= "$catid" num= "5" keywords= "$rs [keywords]"}{loop $data $r} {$r [title]} ({date (' y-m-d ', $r [Inputtime])}) {/loop} {/PC} returns the following table: field type null default comment title char (80) No null recommended bit header URL Char No null recommended bit link address inputtime int (10) No NULL recommended bit release time Thumb char is a NULL recommended bit thumbnail other indeterminate is Other model fields--------------------------------------------------------------------------------5, Column list: Available parameters: Parameter name must default value description CATID no 0 call all columns under this column, default 0, call the first level column $siteid No 1 The default call system site Order No null ordering method, generally according to Listorder as C sort, that is, column add Order num is a null data call number code example: {pc:content action= "category" catid= "0" num= "siteid=" $siteid "order=" Listorder ASC "}{loop $data $r} {$r [catname]}{/loop}{/pc} return parameters as table: field type default description CATID smallint no column Idsiteid tinyint (3) 0 site Idmodule Varch AR (15) No module Idtype tinyint (1) 1 column type Idmodelid tinyint (5) 5 model Idparentid smallint (5) 5 Parent column Arrparentid varchar (255) No parent Child tinyint (1) 0 sub-column Arrchildid Mediumtext no sub-column catname varchar (30) No column name image varchar (100) No column image description Mediumte XT No Column Description Parentdir varchar (100) No parent column directory Catdir varchar (30) No column URL varchar (100) No column links items mediumint (8) 0 column content hits int ( 10) 0 hits setting mediumtext no column Settings Listorder smallint (5) 0 Sort Ismenu tinyint (1) 0 whether sethtml tinyint (1) 0 is generated to root letter Va Rchar (30) No column pinyin
Phpcms v9 Common call label (full)