如何给首页的每个栏目增加一个图片文章?先看效果图:
如何实现:
<{assign var="image_article_id" value="0"}>
<{assign var="article_num" value="12"}>
<{* 从commend_article_data里显示一张图片,可换成new_article_data *}>
<{foreach name=commend_article_data item=item_info from=$data_ary.commend_article[$single_type.id]}>
<{if $item_info.icon_url != '' && $image_article_id == 0 }>
<TABLE align=center width=99%>
<TR>
<TD valign=top><div class=s_img_div style="width:65px;height:65px;border:0px;"><p><A HREF="<{$item_info.url}>"><img src="<{$item_info.icon_url}>" onload="if ( this.width>62 ) {this.width=62;} if (this.height>62){this.height=62;}" border=0></a></p></div></TD>
<TD valign=top><A HREF="<{$item_info.url}>" style="color:black;"><{$item_info.title|cn_truncate:14:"..":true}></A><br>
<FONT COLOR="gray"><{$item_info.desc|cn_truncate:30:"...":true}></FONT>
</TD>
</TR>
</TABLE>
<{assign var="image_article_id" value="`$item_info.id`"}>
<{assign var="article_num" value="`$article_num-4`"}>
<{/if}>
<{/foreach}>