HBCMS模板教程第十一讲:编辑导读(今日头条)

今天终于有空继续写教程了,今天这一节主要讲讲编辑导读,在HBCMS默认模板中叫今日头条。

在我们这个模板中,我们把幻灯片右部的文章列表设置为调用最近更文章的文章列表,最新列表调用代码教程请参见:

我们先看下DEDECMS模板里的这段代码:

{dede:artlist typeid="0" row=6 titlelen=46}

<tr height="22">

<td width="85%" class="indl1">[[field:typelink /]] <a href="[field:filename /]">[field:title/]</a></td>

<td width="15%" align="right" class="date">[field:pubdate function=’strftime("%Y/%m/%d",@me)’/]</td>

</tr>

{/dede:artlist}

我们修改为HBCMS的最新文章代码:

<{foreach name=new_article_data item=item_info from=$data_ary.new_article.0}>

<{if $smarty.foreach.new_article_data.iteration <= 10}>

<tr height="22">

<td width="85%" class="indl1">< a href="<{$item_info.url}>"><{$item_info.title|strip_tags:true|cn_truncate:14:"":true}>< /a>< /td>

<td width="15%" align="right" class="date"><{$item_info.timestamp|date_format:"%Y-%m-%d"}></td>

</tr>

<{/if}>

<{/foreach}>

代码里面的数字的作用请参考以前的教程。

再看下图示:

模板制作系列教程第十一讲:编辑导读(今日头条)” width=”664″ src=”http://cdn.verydemo.com/upload/2013_06_07/13706182766980.jpg” onload=”return imgzoom(this,550);” onclick=”javascript:window.open(this.src);” >

DEDECMS模板代码显示

模板制作系列教程第十一讲:编辑导读(今日头条)” width=”700″ border=”1″ src=”http://cdn.verydemo.com/upload/2013_06_07/13706182767141.jpg” onload=”return imgzoom(this,550);” onclick=”javascript:window.open(this.src);” >

HBCMS模板代码显示

最后看下演示:

模板制作系列教程第十一讲:编辑导读(今日头条)” width=”652″ src=”http://cdn.verydemo.com/upload/2013_06_07/13706182767292.jpg” onload=”return imgzoom(this,550);” onclick=”javascript:window.open(this.src);” >

HBCMS模板教程第十一讲:编辑导读(今日头条)

相关文章:

你感兴趣的文章:

标签云: