午夜dv内射一区二区,无码精品一区二区三区免费视频,天堂网www在线网,无码精品人妻一区二区三刘亦菲,特级欧美aaaaaaa免费观看

幫助中心 > CmsEasy 模板制作 > 列表頁模板 > 文字列表模板

文字列表模板

1、如何編輯列表模板

文字列表模板存放在模板包archive文件夾中,命名以list_text為前綴

 

在模板包中找到list_text.html 模板,復(fù)制另存為一個新模板,命名為list_text_自定義名稱.html

 

自定義名稱可以是英文或拼音,但不能用中文!

 

2、列表模板結(jié)構(gòu)

所有列表頁面模板布局主要分三部分,頁頭/頁中/頁底。


 

2.1 頁頭引用全站通用頁頭模板

 

    {template 'header.html'}

 

2.2 頁中部分為頁面主要顯示內(nèi)容,

文字列表模板主要顯示欄目內(nèi)容列表,并以文字列表形式顯示。

    {loop $archives $archive}
     {$archive['title']}//內(nèi)容標(biāo)題
     {$archive['url']}//內(nèi)容鏈接
     {/loop}


 

2.3 頁底引用全站通用頁底模板

 

    {template 'footer.html'}


 

3、列表模板常用函數(shù)說明

 

列表中引用欄目所屬內(nèi)容列表循環(huán)舉例

    {loop $archives $archive}
     <a title="{$archive['stitle']}" href="{$archive['url']}" target="_blank" >{$archive['title']}</a>
     {/loop}


 

列表中內(nèi)容名稱

    {$archive['title']}


 

列表中內(nèi)容鏈接

    {$archive['url']}


 

列表中內(nèi)容鏈接Title

    {$archive['stitle']}


 

列表中內(nèi)容評級

    {$archive['strgrade']}


 

內(nèi)容簡介

    {$archive['intro']}


 

內(nèi)容縮略圖

    {$archive['thumb']}


 

發(fā)布時間

    {$archive['adddate']}


 

瀏覽次數(shù)

    {$archive['view']}


 

限定引用內(nèi)容文字?jǐn)?shù)量

    {cut(strip_tags($archive['content']),20)}


其中20為字?jǐn)?shù)

 

列表分頁

    {if isset($pages)}
     {category_pagination($catid)}
     {/if}


分頁代碼必須放置在{loop}外部!

 

列表中顯示遞增數(shù)字舉例

    {loop $archives $i $archive}
     {=$i+1}-<a title="{$archive['stitle']}" href="{$archive['url']}" target="_blank" >{$archive['title']}</a>
     {/loop}


其中$i為遞增變量

 

顯示結(jié)果為

    1-文字標(biāo)題
     2-文字標(biāo)題
     3-文字標(biāo)題
     4-文字標(biāo)題
     5-文字標(biāo)題


 

列表中按指定插入內(nèi)容舉例

    {loop $archives $i $archive}
     {if $i%3==0}插入{else}{/if}
     <a title="{$archive['stitle']}" href="{$archive['url']}" target="_blank" >{$archive['title']}</a>
     {/loop}


其中$i為遞增變量

 

顯示結(jié)果為

    文字標(biāo)題
     文字標(biāo)題
     文字標(biāo)題
     插入
     文字標(biāo)題
     文字標(biāo)題


其中3為指定位置

 

CmsEasy 助您「輕松搭建」企業(yè)官網(wǎng)。

 


本文是否有幫助?