phpcms 製作簡單企業站的常用標籤

來源:互聯網
上載者:User

標籤: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 製作簡單企業站的常用標籤

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.