求助大佬
我想循環(huán)指定欄目(id為95)下的子欄目,
給當(dāng)前對(duì)應(yīng)的欄目添加欄目添加類名
但是我第一個(gè)就循環(huán)不出來,不知道哪里出了錯(cuò)
{category module=share pid=95 return=c1}
{if $c1.child}
{category module=share pid=$c1.id return=c2}
<a href="#" class="item on">{$c2.name}</a>
{/category}
{/if}
{/category}官方提醒:使用category欄目循環(huán)標(biāo)簽的生成工具,填寫參數(shù)就可以生成相關(guān)的代碼,每個(gè)參數(shù)后面都有用法解釋
{category module=share pid=95 return=c1} {if $c1.child} {category module=share pid=$c1.id return=c2} <a target="_blank" href="#" class="item on">{$c2.name}</a> {/category} {/if} {/category}不需要寫這句話了
{if $c1.child}開源是一種精神,但不是義務(wù),幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問題!
回復(fù)@迅??蚣芗夹g(shù)-景攸

{category module=share pid=95 return=c1} {category module=share pid=$c1.id return=c2} <a href="#" class="item on">{$c2.name}</a> {/category} {/category}還是不生效呀,大大~
你為什么要加兩層呢
{category module=share pid=95 return=c2} <a target="_blank" href="#" class="item on">{$c2.name}</a> {/category}開源是一種精神,但不是義務(wù),幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問題!