今天繼續講主體部分
{template "content","header"}
調用根目錄下phpcms/template/content/header檔案
這個是模版註解!建議一定要養成寫程式碼加註解的習慣
這個是div標籤,不知道什麼是div可以的去網上找些教學學習下,這個都不了解就沒必要繼續看了
<!--这里是pc标签{pc:content 参数名="参数值" 参数名="参数值" 参数名="参数值"}--> {pc:content action="position" posid="2" order="listorder DESC" num="4"} <!--显示PC标签中的数据--> {loop $data $r} {str_cut($r[title],36)} {if $n==1}{/if}{str_cut($r[description],112)} {/loop} {/pc} <!--结束标签--> <!--这里还是pc标签--> {pc:content action="position" posid="1" order="listorder DESC" thumb="1" num="5"} {loop $data $r} {/loop} {/pc} 推广 {pc:block pos="index_block_1"} {/pc} 图片新闻 {pc:content action="position" posid="12" thumb="1" order="id DESC" num="10"} {loop $data $r} {str_cut($r[title],20)} {/loop} {/pc} {loop subcat(0,0,0,$siteid) $r} {php $num++} {$r[catname]}更多>> {pc:content action="lists" catid="$r[catid]" num="1" thumb="1" order="id DESC" return="info"} {loop $info $v} {str_cut($v['title'],28)} {str_cut($v['description'],100)} {/loop} {/pc} {pc:content action="lists" catid="$r[catid]" num="5" order="id DESC" return="info"} {loop $info $v} ·{str_cut($v['title'],40)} {/loop} {/pc} {if $num%2==0} {/if} {/loop} 公告 {pc:announce action="lists" siteid="$siteid" num="2"} {loop $data $r} {$r['title']} {/loop} {/pc} 专题更多>> {pc:special action="lists" siteid="$siteid" elite="1" listorder="3" num="2"} {loop $data $r} {if $n!=1} {/if} {str_cut($r[title],'18')} {str_cut($r['description'],50)} {/loop} {/pc} 热点 | 评论 | 关注排行 {pc:content action="hits" catid="35" num="10" order="views DESC"} {loop $data $r} {$r[title]} {/loop} {/pc} {pc:comment action="bang" num="10" cache="3600"} {loop $data $r} {$r[title]} {/loop} {/pc} {pc:content action="hits" catid="35" num="10" order="views DESC"} {loop $data $r} {$r[title]} {/loop} {/pc} 调查问卷更多>> 更多>>友情链接申请链接 {pc:link action="type_list" siteid="$siteid" linktype="1" order="listorder DESC" num="8" return="pic_link"} {loop $pic_link $v} {/loop} {/pc} {pc:link action="type_list" siteid="$siteid" order="listorder DESC" num="10" return="dat"} {loop $dat $v} {if $type==0} {$v[name]} | {else} {/if} {/loop} {/pc} $(function(){ new slide("#main-slide","cur",310,260,1);//焦点图 new SwapTab(".SwapTab","span",".tab-content","ul","fb");//排行TAB }) {template "content","footer"}
以上就是phpcms v9模板製作教學(三)的內容,更多相關內容請關注PHP中文網(m.sbmmt.com)!