国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > CMS > PhpCMS > 正文

phpcms標簽模板及專題模板的制作

2024-09-10 07:16:28
字體:
來源:轉載
供稿:網友
關鍵字描述:模板 制作 專題 標簽 " < article if /if > class

phpcms標簽模板及專題模板的制作

1.標簽模板的制作
前面我們已經講到了每個頻道模板的制作,但是我們只是插入對應的標簽代碼,如何做到顯示的效果能個性化,滿足自己的要求呢?,那么我們就要對自己的標簽模板做個性化的設計
所有以tag_開頭的模板
都是標簽模板
以文章頻道的模板為例

我們會看到
tag_articlelist.html 文章列表標簽模板
tag_picarticle.html 圖片文章標簽模板
剩下的兩個我們一般做模板的時候,如果自己對于js代碼不是很理解的話,我們一般不會去動它,
打開文章列表標簽模板

CODE: [Copy to clipboard] <table width="100%" border="0" align="center" cellpadding="1" cellspacing="1">
{loop $articles $i $article}
{if $i%$cols==0} <tr> {/if}
<td height="20" width="{$width}">
{$article[img]} {if $showcatname}{$article[catname]}{/if} <a href="{$article[url]}" title="{$article[alt]}" target="{$target}" class="tag_title_link">{$article[title]}</a>
{if $showhits}({$article[hits]}){/if}
{if $showauthor}[作者:{$article[author]}]{/if}
{if $article[showcommentlink]}&nbsp;<a href="{PHPCMS_PATH}comment/?item=articleid&itemid={$article[articleid]}" target="_blank"><span class="color_red">評</span></a>{/if}
{if $datetype}[<span class="tag_date">{$article[adddate]}</span>]{/if}
{if $descriptionlen}<br/><span class="tag_description">&nbsp;&nbsp;&nbsp;&nbsp;{$article[description]}</span>{/if}
</td>
{if $i%$cols==($cols-1)}</tr>{/if}
{/loop}
</table>

{if $pages}
<div class="pages">{$pages}</div>
{/if} 這個里面
{loop $articles $i $article}是一個循環,我們要關注的就是這個循環里面的內容
{if $i%$cols==0} <tr> {/if} 我們在標簽里面設定的參數,顯示幾列,根據這個來控制標簽的顯示
{$article[img]} 文章的圖片,顯示精華,置頂,還是普通文章
{if $showcatname}{$article[catname]}{/if} 所屬欄目

{$article[url]} 文章路徑

{$article[title]} 文章標題
{if $showhits}({$article[hits]}){/if} 點擊數
{if $showauthor}[作者:{$article[author]}]{/if} 作者
{if $article[showcommentlink]} <a href="{PHPCMS_PATH}comment/?item=articleid&itemid={$article[articleid]}" target="_blank"><span class="color_red">評</span></a>{/if} 評論連接
{if $datetype}[<span class="tag_date">{$article[adddate]}</span>]{/if} 添加時間
{if $descriptionlen}<br/><span class="tag_description"> {$article[description]}</span>{/if} 描述說明

如果我們要實現時間的靠右對齊,那么我們可以把這個模板改成

CODE: [Copy to clipboard] <table width="100%" border="0" align="center" cellpadding="1" cellspacing="1">
{loop $articles $i $article}
上一頁12 下一頁 閱讀全文
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 宜春市| 唐海县| 革吉县| 巴塘县| 民县| 苏尼特左旗| 梁山县| 天长市| 聂荣县| 肥乡县| 滁州市| 凤台县| 定远县| 七台河市| 龙泉市| 东阿县| 灌南县| 富平县| 新兴县| 永和县| 罗城| 新闻| 安陆市| 通州区| 吴川市| 潜江市| 云和县| 建始县| 吉首市| 阿图什市| 荆州市| 许昌县| 方正县| 白山市| 通辽市| 阿坝| 彰化市| 钦州市| 南川市| 启东市| 启东市|