美文网首页
eyoucms 导航菜单判断是否有子栏目,有则显示否则隐藏(二

eyoucms 导航菜单判断是否有子栏目,有则显示否则隐藏(二

作者: 西祠_fa33 | 来源:发表于2019-03-08 08:45 被阅读0次

{eyou:channel type="top" row="10" id="field" currentstyle="active"}

<li class="yiji"> <a href="{$field.typeurl}" title="{$field.typename}" class="{$field.currentstyle}">{$field.typename}</a> 

 {eyou:notempty name="$field.children"}

 <div class="erji"> 

  {eyou:channel name="$field.children" row="100" id="field2"} 

   <a href="{$field2.typeurl}" class="dropdown-item ">{$field2.typename}</a> 

  {/eyou:channel}

 </div>

 {/eyou:notempty}

</li> 

{/eyou:channel}

上述代码红色部分就是判断是否隐藏二级栏目的代码,其判断为有子栏目时就显示,没有

有子栏目时就隐藏。

转自:https://www.eyoucms.com/help/eyoujq/646.html

相关文章

网友评论

      本文标题:eyoucms 导航菜单判断是否有子栏目,有则显示否则隐藏(二

      本文链接:https://www.haomeiwen.com/subject/jwdlpqtx.html