联系官方销售客服
1835022288
028-61286886
{list action=category module=share num=6 pid=0}
<li id="menu-10157-1" class="{if $catid && in_array($catid, $t.catids)}active-trail{/if} middle even sf-item-2 sf-depth-1 sf-total-children-12 sf-parent-children-5 sf-single-children-7 menuparent"> <a href="{$t.name}" class="sf-depth-1 menuparent">{$t.name}</a> {if $t.child}
<ul>
{list action=category module=share pid=$t.id return=t2}
{if $t2.child}
<li id="menu-11737-1" class="middle even sf-item-2 sf-depth-2 sf-total-children-6 sf-parent-children-0 sf-single-children-6 menuparent"> <a href="{$t2.url}" class="sf-depth-2 menuparent">{$t2.name}</a>
<ul>
{list action=category module=share pid=$t2.id return=t3}
<li id="menu-10161-1" class="first odd sf-item-1 sf-depth-3 sf-no-children"><a href="{$t3.url}" class="sf-depth-3">{$t3.name}</a></li>
{/list}
</ul>
</li>
{else}
{list action=category module=share pid=$t.id return=t2}
<li id="menu-10178-1" class="first odd sf-item-1 sf-depth-2 sf-no-children"><a href="{$t2.url}" class="sf-depth-2">{$t2.name}</a></li>
{/list}
{/if}
{/list}
</ul>
{/if} </li>
{/list}
这个 判断 没生效呢 :目的是判断 有无三级栏目 有三级 输出上面的 样式 没有 三级 输出下面的 样式:
目前是
反复循环了 谢谢
{list action=category module=share pid=$t.id return=t2}
<li id="menu-10178-1" class="first odd sf-item-1 sf-depth-2 sf-no-children"><a target="_blank" href="{$t2.url}" class="sf-depth-2">{$t2.name}</a></li>
{/list}改成 <li id="menu-10178-1" class="first odd sf-item-1 sf-depth-2 sf-no-children"><a target="_blank" href="{$t2.url}" class="sf-depth-2">{$t2.name}</a></li>
官方默认模板有现成的写法,可以借鉴