Phpcms V9內容頁show模板呼叫標籤一覽
內容頁是每個站點都必須要有的模板,最常見的就是文章的內容頁,再者有下載內容頁,產品內容頁,視訊內容頁等等,但一般不大的站點都一定要有其文章的內容頁,其它幾個可以沒有,在內容頁當中,其實是有一些固定的模板標籤的,我們只需要呼叫就可以了,這些標籤可以在 phpcms v9 裡面摘出來,在使用的時候直接呼叫很方便的,現在就來總結一下內容頁 show 模板呼叫的標籤。
1、頁面標題:{$title}
2、發表時間:{$inputtime}
3、內容來源:{$copyfrom}
4、文章內容:{$content}
5、縮圖地址:{$thumb}
6、組圖列表:
1 2 |
{loop $photos $r }
<li><a
href= "{$r[url]}" ><img
src= "{thumb($r[url],
75, 45, 0)}"
/>{/loop}
|
註釋:其中$photos為自定義組圖欄位,{$r[url]}為圖片地址,{thumb($r[url], 75, 45, 0)}為圖片縮圖,{$r[alt]}為圖片描述。
7、欄目名稱與欄目拼音與欄目連結:{$CAT[catname]} 與 {$CAT[letter]} 與 {$CAT[url]}
8、同級欄目列表:
1 2 3 4 5 |
{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}
|
9、父欄目名稱與連結:{$CATEGORYS[$CAT[parentid]][catname]} 與 {$CATEGORYS[$CAT[parentid]][url]}
10、一級父欄目列表:
1 2 3 4 5 |
{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}
|
11、 獲取上上級欄目名稱與連結:{$CATEGORYS[$CATEGORYS[$CAT[parentid]][parentid]][catname]} 與 {$CATEGORYS[$CATEGORYS[$CAT[parentid]][parentid]][url]}
12、上一篇:{$previous_page[url]}、{$previous_page[title]},下一篇:{$next_page[url]}、{$next_page[title]}。
13、相關熱詞搜尋:
1 2 3 |
{loop $keywords $keyword }
<a
href= "{APP_PATH}index.php?m=content&c=tag&catid={$catid}&tag={urlencode($keyword)}" class = "blue" >{ $keyword }</a>
{/loop}
|
14、點選統計:,注意在底部加上統計程式碼:
15、相關文章呼叫:
1 2 3 4 5 6 7 8 9 10 11 12 |
{pc:content
action= "relation" relation= "$relation" id= "$id" catid= "$catid" num= "5" keywords= "$rs[keywords]" }
{ if $data }
<div class = "related" >
<h5 class = "blue" >延伸閱讀:</h5>
<ul class = "list
blue lh24 f14" >
{loop $data $r }
<li>·<a
href= "{$r[url]}" target= "_blank" >{ $r [title]}</a><span>({ date ( 'Y-m-d' , $r [inputtime])})</span></li>
{/loop}
</ul>
</div>
{/ if }
{/pc}
|
這些模板標籤都可以在 phpcms v9 預設模板裡面找出來,這裡記錄一下方便自己在做模板時直接拿來呼叫,當然我們可以舉一反三,比如列表頁 list.html 模板標籤,首頁 index.html 模板標籤,把這些標籤都收集下來,可以提高自己製作模板的效率額。