<p>
<a href="/Mobile/MProducts/lmobglrm03A.html" title="羅密歐壁掛爐RM03A">
<img src='yangshi/picture/20200829135703_3881.png_130x130.jpg' height='130' alt='羅密歐壁掛爐RM03A' title='羅密歐壁掛爐RM03A'>羅密歐壁掛爐RM03A
</a>
<a href="/Mobile/MProducts/lmobglrm05A.html" title="羅密歐壁掛爐RM05A">
<img src='yangshi/picture/20210320100104_8711.jpg_130x130.jpg' height='130' alt='羅密歐壁掛爐RM05A' title='羅密歐壁掛爐RM05A'>羅密歐壁掛爐RM05A</a>
</p>我想循環(huán)這個p標簽 里面的兩個不同的數(shù)據(jù) 怎么循環(huán)呢
回復(fù)@找尋知音 我想過用if 條件判斷 但是 我這個不清除怎么判斷
寫段偽代碼吧 應(yīng)該很好理解
<p>
{foreach}
<a></a>
{if (key%2==0 && key<總數(shù))}
</p><p>
{/if}
{/foreach}
</p>
回復(fù)@Along 看不懂啊
用取余哦按段
{if $key%2 !=0}<p>{/if}
{if $key%2 ==0}</p>{/if}
回復(fù)@億友 你這個好像 和我要的結(jié)果不一樣啊
你不是要這樣的嗎?兩個循環(huán)再<p>之內(nèi)
{if ($key+1)%2 !=0}<p>{/if} <a href="/Mobile/MProducts/lmobglrm03A.html" title="羅密歐壁掛爐RM03A"> <img src='yangshi/picture/20200829135703_3881.png_130x130.jpg' height='130' alt='羅密歐壁掛爐RM03A' title='羅密歐壁掛爐RM03A'>羅密歐壁掛爐RM03A </a> <a href="/Mobile/MProducts/lmobglrm05A.html" title="羅密歐壁掛爐RM05A"> <img src='yangshi/picture/20210320100104_8711.jpg_130x130.jpg' height='130' alt='羅密歐壁掛爐RM05A' title='羅密歐壁掛爐RM05A'>羅密歐壁掛爐RM05A</a> {if ($key+1)%2 ==0}</p>{/if}{if ($key+1)%2 !=0 && $is_last}</p>{/if}回復(fù)@億友 中間一個商品就好了
回復(fù)@曉猛seo
<p> {module module=news catid=1 order=displayorder,updatetime num=10} <a href="{$t.url}"> <img src='yangshi/picture/20200829135703_3881.png_130x130.jpg' height='130'>{$t.title} </a> {if ($key+1)%2 ==0 && !$is_last} </p><p> {/if} {/module} </p>