請教我這樣寫不對嘛,同頁面中有一個(gè)了這樣的代碼了,另一個(gè)好用,這個(gè)不好二級欄目出不來
{category module=shop id=2 }
<a href="{$t.url}" class="fl i">{$t.name}</a>
{if $t.child}
{category module=shop pid=$t.id return=t2 }
<a href="{$t2.url}" class="fl i">{$t2.name}</a>
{if $t2.child}
{category module=shop pid=$t2.id return=t3}
<a href="{$t3.url}" class="fl i">{$t3.name}</a>
{/category}
{/if}
{/category}
{/if}
{/category}官方提醒:使用category欄目循環(huán)標(biāo)簽的生成工具,填寫參數(shù)就可以生成相關(guān)的代碼,每個(gè)參數(shù)后面都有用法解釋
以解決
使用官方的category欄目循環(huán)標(biāo)簽的生成工具,以解決問題
{category module=shop pid=2 num=4 return=c1}
<a href="{$c1.url}" class="fl i">{$c1.name}</a>{if $c1.child}
{category module=shop pid=$t.id return=c12 }
<a href="{$c12.url}" class="fl i">{$c12.name}</a>
{/category}
{/if}
{/category}