模板标签里面
请问下,如何判断3级栏目为空的时候,不显示所有栏目?
{if !$c3.name}
{category module=store pid=0 return=c1}<br>
大类:{$c1.name}<br>
{category module=store pid=$c1.id return=c2}<br>
中类:{$c2.name}<br>
{category module=store pid=$c2.id return=c3}
<li>{$c3.name}</li>
{/category}
{/category}
<hr>
{/category}
{else}
{/if}这样好像不对~
{if !$c3.name}第一句这是什么意思,没看懂{if !$c3.name}为什么加这个啊,这样肯定永远是true用三楼的思路可行
{category module=store pid=0 return=c1}<br> 大类:{$c1.name}<br> {if $c1.child} {category module=store pid=$c1.id return=c2}<br> 中类:{$c2.name}<br> {if $c2.child} {category module=store pid=$c2.id return=c3} <li>{$c3.name}</li> {/category} {/if} {/category} {/if} <hr> {/category}默认模板就有这种判断的写法了{php $sanji=0;} {category module=store pid=0 return=c1} {if $c1.child} {category module=store pid=$c1.id return=c2} {if $c2.child} {category module=store pid=$c2.id return=c3} {php $sanji=1;} {/category} {/if} {/category} {/if} {/category} {if $shanji} 最后一集存在的 {else} 最后一集不存在的 {/if}