ecshop foreach控制文章显示条数

底部帮助中心为例:

<!--{if $helps}-->

<!-- {foreach from=$helps item=help_cat} -->

<dl>

  <dt><a href='{$help_cat.cat_id}' title="{$help_cat.cat_name}"><font color="#FFFFFF">{$help_cat.cat_name}</font></a></dt>

  <!-- {foreach from=$help_cat.article item=item name=help_foreach} -->

  <!--{if $smarty.foreach.help_foreach.index <= 2} 帮助显示3条数-->

  <dd><a href="{$item.url}" title="{$item.title|escape:html}">{$item.short_title}</a></dd>

  <!---{/if}-->

  <!-- {/foreach} -->

</dl>

<!-- {/foreach} -->

<!--{/if}-->

 

 

红色控制显示数目{0 开始}

记住粉色部分别忘记了。

转载自网络。

posted @ 2012-08-17 23:03  沐雪架构师  阅读(555)  评论(0编辑  收藏  举报