標籤:data 地址 模組 asc 判斷 欄目 size template style
標題 title 關鍵字 keywords 描述 description
來源 copyfrom 允許訪問 allow_visitor==1 thumb 縮圖
{template "content","header"} 引入頭
{template "content","footer"}引入尾
{pc:content action="category" catid="0" num="25" siteid="$siteid" order="listorder ASC"}
{loop $data $r}
{/loop}
{/pc}
<-- PC標籤 -->
pc:content 代表調用content內容模組
action="category" category(欄目) 調用category欄目
action="lisis" lisis(內容資料列表) 調用列表
catid="0" 找父級欄目 所有一級欄目的父級欄目是0
num="25" 最多取多少條
siteid="$siteid" 網站的id 只有一個網站就是siteid="$siteid"
order="listorder ASC" 根據排序排序 ASC升序
<-- LOOP標籤 -->
外層的PC就像寫了一個SQL語句,然後用LOOP遍曆
$data 相當於二維數組
$r $data取出的每一項交給$r
{siteurl($siteid)} 取網站路徑id地址
class裡面加select 選中變色
<-- if標籤 -->
if 判斷
例子:
{if $top_parentid==0}
<a href="{siteurl($siteid)}">
<div class="h-item select">首頁</div>
</a>
{else}
<a href="{siteurl($siteid)}">
<div class="h-item">首頁</div>
</a>
{/if}
用if判斷 $top_parentid 的上級代號,點擊選中變色,不選中不變色
$catid==$r[catid] 判斷當前地址欄id是否等於要選中的id
$top_parentid==$r[catid] 用於二級、三級欄目
{if isset($SEO[‘title‘]) && !empty($SEO[‘title‘])}{$SEO[‘title‘]}
{/if}{$SEO[‘site_title‘]}
替換網頁的標題
<meta name="keywords" content="{$SEO[‘keywords‘]}"> 網站關鍵字
<meta name="description" content="{$SEO[‘description‘]}"> 網站描述
取消來源後邊的 “|0”
{php list($copyfrom) = explode(‘|‘,$val[copyfrom])}
{$copyfrom}
加分頁 page="$page" num設定一頁輸出幾行
輸出:{$pages}
加時間 {date(‘Y-m-d H:i:s‘,$val[inputtime])}
phpcms 製作簡單企業站的常用標籤