在一些购物网站中,我们经常看到商品排行榜或者商品热门排行左侧有精美的序列号显示,比如1,2,3,4,5等,这样的效果制作其实很简单,就是通过循环将产品递归增加。
使用ECSHOP建站过程中,有时需要使用到商品排行榜之类的,需要循环输出序列号1.2.3.4…等。下面来看看如何操作吧,其实很简单,注意下边标颜色的参数要对应才行。
1 2 3 4 5 6 7 8 | <!--{ foreach name=cat_id1_hot_goods from= $cat_id1_hot_goods item=g oods}--> <li><span class = "color" >{ $smarty . foreach .cat_id1_hot_goods.iterati on}</span> <a href= "{$goods.url}" title="{ $goods .name|escape:html }">{ $goods .name}</a> <div><img src= "{$goods.thumb}" width= "233" height= "140" alt="{ $goo ds.name|escape:html}" /></div></li> <!--{/ foreach }--> |
联系客服