方法一: <!--{foreach from=$cat_goods_2 item=goods name="cat_goods_2"}--> <!--{if $smarty.foreach.cat_goods_2.iteration <= 6}--> <div class="textleft">·<a target=_blank href="{$goods.url}" title="{$goods.name|escape:html}">{$goods.name|escape:html} <span class="p1 font"> <!-- {if $goods.promote_price neq ""} --> {$goods.promote_price} <!-- {else}--> {$goods.shop_price} <!--{/if}--> </span></a></div> <!---{/if}--> <!--{/foreach}-->
方法二: <!--{foreach from=$cat_goods_1 item=goods name="cat_goods_1"}--> <!-- {if $smarty.foreach.cat_goods_1.index lt 6} **文章显示数量 --> <div class="textleft">·<a target=_blank href="{$goods.url}" title="{$goods.name|escape:html}">{$goods.name|escape:html} <span class="p1 font"> <!-- {if $goods.promote_price neq ""} --> {$goods.promote_price} <!-- {else}--> {$goods.shop_price} <!--{/if}--> </span></a></div> <!---{/if}--> <!--{/foreach}-->
|