聯(lián)系官方銷售客服
1835022288
028-61286886
{category module=share pid=0 return=c1} <li> <a href="{$c1.url}" >{$c1.name}</a> {/category}
這種循環(huán)里面,怎么判斷循環(huán)的主欄目,有沒有子欄目呢?
官方提醒:使用category欄目循環(huán)標簽的生成工具,填寫參數(shù)就可以生成相關(guān)的代碼,每個參數(shù)后面都有用法解釋
這個pid=0表示循環(huán)頂級欄目,不循環(huán)子欄目
回復(fù)@迅??蚣芗夹g(shù)-田聰明
{category module=share pid=0 return=c1}
<li> <a href="{$c1.url}" class="" >{$c1.name}</a>
<ul >
{category module=share pid=$c1.id return=c2}
<li><a href="{$c2.url}">{$c2.name}</a></li>
{/category}
</ul>
</li>
{/category}
是這樣的,我就想判斷循環(huán)的主欄目下,有沒有子欄目。
這個方法只能在:category.html,list.html,show.html中用,如果是要欄目循環(huán)中判斷,應(yīng)該怎么寫呢?
默認模板的header.html有現(xiàn)成的代碼啊