菠萝教你做模板之六-标签模板及专题模板的制作(2)_PHPCms教程

编辑Tag赚U币
教程Tag:暂无Tag,欢迎添加,赚取U币!
评论连接
{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模板的!

查看更多 phpcms教程  phpcms模板

来源:模板无忧//所属分类:PHPCms教程/更新时间:2007-01-29
相关PHPCms教程