导航条二级栏目输出
{{$channels=c(0,999,0)}} {{loop $channels as $channel}} <a href="{{$channel['url']}}" class="{{$channel['onstyle']}}">{{$channel['name']}}</a> : {{$channels2=c(0,999,$channel['cid'])}} {{loop $channels2 as $channel2}} <a href="{{$channel2['url']}}" class="{{$channel2['onstyle']}}">{{$channel2['name']}}</a> {{/loop}}<br> {{/loop}} //如果需要判断栏目设置成是否显示在导航 则需要加判断 {{if $channel['ifshownav']}} <a href="{{$channel['url']}}" class="{{$channel['onstyle']}}">{{$channel['name']}}</a> {{/if}} //判断是否存在二级栏目 {{$channels2=c(0,999,$channel['cid'])}} {{if count($channels2)}} xxxx {{/if}} 二级栏目也需要判断 把上面代码中的$channel换成$channel2即可 1.4.1版本开始c函数支持只列出显示在导航栏的栏目, 如:{{$channels=c(0,999,0,1)}},第四个参数 填写1则只列出显示在导航栏的栏目, 不再需要判断$channel['ifshownav'] //加上首页判断 {{if cid==0}} <a href="/" class="on">首页</a> {{else}} <a href="/">首页</a> {{/if}}