联系官方销售客服

1835022288

028-61286886

求助 版主:论坛审计组
样式循环判断求解
类型:迅睿CMS 更新时间:2018-03-20 20:54:13
回帖
  • 秋冬
    #1楼    秋冬
    2018-03-19 13:39:23
    0
    {category module=goods pid=1}
    {if $key%2} <p class="item1_top">{/if}
    <a target="_blank" href="{$t.url}" target="_blank">{$t.name}</a>   
    {if $key%2==1} </p>{/if}
    {/category}
  • 华仔
    #2楼    华仔
    2018-03-19 14:10:45
    0
    测试了下这个方法行不通调用出来变成这样的了
    <a target="_blank" target="_blank" href="danxie.html" target="_blank">单鞋</a> <p class="item1_top"><a target="_blank" target="_blank" href="xiaobaixie.html" target="_blank">小白鞋</a> </p><a target="_blank" target="_blank" href="dibangxie.html" target="_blank">低帮鞋</a> <p class="item1_top"><a target="_blank" target="_blank" href="fanbuxie.html" target="_blank">帆布鞋</a> </p><a target="_blank" target="_blank" href="neizenggaoxie.html" target="_blank">内增高鞋</a> <p class="item1_top"><a target="_blank" target="_blank" href="liangxie.html" target="_blank">凉鞋</a> </p><a target="_blank" target="_blank" href="tuoxie.html" target="_blank">拖鞋</a> 我要的效果是这样的

    <p class="item1_top">

    <a target="_blank" href="{$t.url}" target="_blank">{$t.name}</a>

    <a target="_blank" href="{$t.url}" target="_blank">{$t.name}</a>

    <a target="_blank" href="{$t.url}" target="_blank">{$t.name}</a>

    </p>

    <p class="item1_bot">

    <a target="_blank" href="{$t.url}" target="_blank">{$t.name}</a>

    <a target="_blank" href="{$t.url}" target="_blank">{$t.name}</a>

    <a target="_blank" href="{$t.url}" target="_blank">{$t.name}</a>

    </p>【秋冬】1楼

  • 老豆
    #3楼    老豆
    2018-03-19 17:10:19
    0
    {category module=goods pid=1}
    {if $key%2 == 0} <p class="item1_top">{/if}
    <a target="_blank"  target="_blank" href="{$t.url}" target="_blank">{$t.name}</a>   
    {if $key%2==1} </p>{/if}
    {/category}
  • 华仔
    #4楼    华仔
    2018-03-19 19:35:15
    0
    还是不行,调用出来变成这样了
     <p class="item1_top"><a target="_blank"  target="_blank"  target="_blank" href="goods/danxie.html" target="_blank">单鞋</a>   
    <a target="_blank"  target="_blank"  target="_blank" href="goods/xiaobaixie.html" target="_blank">小白鞋</a>   
     </p> <p class="item1_top"><a target="_blank"  target="_blank"  target="_blank" href="goods/dibangxie.html" target="_blank">低帮鞋</a>   
    <a target="_blank"  target="_blank"  target="_blank" href="goods/fanbuxie.html" target="_blank">帆布鞋</a>   
     </p> <p class="item1_top"><a target="_blank"  target="_blank"  target="_blank" href="goods/neizenggaoxie.html" target="_blank">内增高鞋</a>   
    <a target="_blank"  target="_blank"  target="_blank" href="goods/liangxie.html" target="_blank">凉鞋</a>   
     </p>
    {category module=goods pid=258 num=6}
    {if $key%2 == 0} <p class="item1_top">{/if}
    <a target="_blank"  target="_blank"  target="_blank" href="{$t.url}" target="_blank">{$t.name}</a>   
    {if $key%2==1} </p>{/if}
    {/category}
    上面是调用的代码
    需要实现的效果
    image.png
    【老豆】3楼
  • 张明宇
    #5楼    张明宇
    2018-03-20 09:38:01
    0
    {category module=goods pid=1}
    {if $key%3 == 0} <p class="item1_top">{/if}
    <a href="{$t.url}" target="_blank">{$t.name}</a>   
    {if $key%2==1} </p>{/if}
    {/category}
    改下参数就行,人家给你发的例子,你不要照搬
    满意答案
  • 华仔
    #6楼    华仔
    2018-03-20 20:54:13
    0
    感谢大家给我解决此问题,我已经完美的解决