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

首頁 > CMS > PhpCMS > 正文

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

2024-07-09 22:52:45
字體:
來源:轉載
供稿:網友
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}
{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 $descriptionlen}<br/><span class="tag_description">&nbsp;&nbsp;&nbsp;&nbsp;{$article[description]}</span>{/if}
</td>
<td>{if $datetype}[<span class="tag_date">{$article[adddate]}</span>]{/if}</td>
{if $i%$cols==($cols-1)}</tr>{/if}
{/loop}
</table>

{if $pages}
<div class="pages">{$pages}</div>
{/if} 或者設置css里面tag_date的屬性為float:right

圖片文章頁面的標簽模板也是如此,我們需要做的,基本上就是css的變化來控制效果,這就需要大家對于css有一個比較淺顯的掌握,具體可以參考css手冊,網上到處都是,指的說明的一點,css的簡寫僅僅支持IE,FF和opera尚不能全部支持!

2.專題模板的制作
專題頁面的制作主要設計的頁面有
special.html 專題首頁
special_list.html 專題列表頁
special_show.html專題內容頁
tag_speciallist.html專題標簽頁
專題是相同類型的文章組成的一個合集,大家可以把他看做一個欄目,只不過這個欄目比較特殊,它屬于一個頻道多個欄目下相同主題的文章合集,他的模板制作和文章欄目頁面的制作是一模一樣的,只不過是概念你的不同罷了,大家不要被這個概念嚇到了!

寫到這里,菠蘿教你做模板系列基本要完工了,剩下的模板中,官方在默認模板中都有了相應的提示文件,相信不是很難看懂
這個教程希望對大家做模板有一個啟發,請大家牢牢記住這一點
phpcms的模板就是html代碼+js+標簽
只要大家靈活掌握標簽的調用,那么一定會做出很多個性化的pp模板的!
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 榆树市| 阿城市| 临海市| 苏州市| 莒南县| 长丰县| 浦江县| 庐江县| 嫩江县| 六枝特区| 荔波县| 科尔| 永嘉县| 宜黄县| 金乡县| 峨边| 阿拉尔市| 襄汾县| 富川| 桦南县| 高清| 黄梅县| 闽侯县| 东乡族自治县| 迭部县| 禹州市| 哈尔滨市| 贵定县| 隆化县| 福建省| 南召县| 景洪市| 延边| 沭阳县| 惠安县| 乌什县| 荔浦县| 宿松县| 祁阳县| 甘洛县| 多伦县|