Phpcms -- template label detailed instructions, phpcms Template
Phpcms is always used to query various tags, so it is really annoying to find a full range for future reference. It is not so easy to embed An orm into the engine seamlessly when it is used together with the call.
Obtain the subcategory under the parent category
{Loop subcat (77) $ k $ v}
{Php $ subcatid [] = $ k ;}
{/Loop}
<? Php $ subcatid = implode (',', $ subcatid);?> The results can be used in the SQL in clause.
{template "content","header"}
Call the phpcms \ template \ content \ header file in the root directory
{template "content","footer"}
Call the phpcms \ template \ content \ footer file in the root directory
{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}
Replace the address with \ statics \ css under the root directory.
{JS_PATH}
Replace the address with \ statics \ js under the root directory.
{pc:content action="position" posid="9" order="id" num="10" cache="3600"}
Pc tag {pc: content parameter = "parameter value" parameter name = "parameter value" parameter name = "parameter value "}
{loop $data $k $v} <li><a href="{$v[url]}">{$v[title]}</a></li>{/loop}
Pc tag Value
Action = "position" -------------- dialog box type = "content recommendation bit list" posid = "9" ---------------------- recommendation bit ID = "9" order = "id" --------------------- sorting type = "id "num =" 10 "-------------------- number of data calls =" 10 "cache =" 3600 "------------------- cache =" 3600 "millisecond {get_siteid ()} {IMG_PATH} replace action = "hits" rankings with images, and hotspot actions = "lists" are mainly used for lists. Catid = "$ catid" specifies the number of the current topic ID, that is, order = "id DESC" order = "id desc" order = "id ASC" sort by ID in descending order "views DESC" sort "= "1" thumbnail return = "" page = "$ page" requires pagination
This occurs every time the list contains several rows.
{if $num%2==0} {/if}
Loop tag
{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 Truncation------ {Str_cut ($ r [title], 40 ,'...')}
Thumbnail--------- When the loop is info, use {thumb ($ r [thumb], 110,0)} When the loop is data, use {thumb ($ v [thumb], 90,0 )}
Paging tag------ {$ Pages}
Article Tab
Title ------- {$ title} content ------- {$ content} date ------- {$ inputtime} source ------- {$ copyfrom} clicks ------ <span id = "hits"> </span>
<script language="JavaScript" src="{APP_PATH}api.php?op=count&id={$id}&modelid={$modelid}"></script>
Homepage---------------- {Siteurl ($ siteid )}
Current location---------------- {Catpos ($ catid )}
Topic name---------------- {$ CAT [catname]}
Topic pinyin---------------- {$ CAT [letter]}
Topic Link---------------- {$ CAT [url]}
Parent topic name-------------- {$ CATEGORYS [$ CAT [parentid] [catname]}
Parent Topic Link-------------- {$ CATEGORYS [$ CAT [parentid] [url]}
Upper-level topic name-------- {$ CATEGORYS [$ CATEGORYS [$ CAT [parentid] [parentid] [catname]}
Link to the upper-level topic-------- {$ CATEGORYS [$ CATEGORYS [$ CAT [parentid] [parentid] [url]}
Parent topic list (catid = 0)
{pc:content action="category" catid="0" num="34" siteid="$siteid" order="listorder ASC"} {loop $data $r} <li><a href="{$r[url]}">{$r[catname]}</a></li> {/loop}{/pc}
Peer column list
{pc:content action="category" catid="$parentid" num="12" siteid="$siteid" order="listorder ASC"} {loop $data $r} <li><a href="{$r[url]}">{$r[catname]}</a></li> {/loop}{/pc}
Group chart list
{loop $photos $r} <li><a href="{$r[url]}"></a></li>{/loop}
Note: $ photos is the custom image group field, {$ r [url]} is the image address, {thumb ($ r [url], 75, 45, 0 )} it is an image thumbnail, and {$ r [alt]} is an image description.
Note: This article is based on feng's blog. you can log on to phpcmsv9 for more details.