首页 > 其他分享 >易优CMS判断顶级栏目下是否有子栏目,没有则不显示

易优CMS判断顶级栏目下是否有子栏目,没有则不显示

时间:2024-07-13 10:57:45浏览次数:15  
标签:栏目 易优 顶级 有子 field eyou channel

判断顶级栏目下是否有子栏目,没有则不显示。

红色代码就是判断代码
{eyou:empty name="$eyou.field.typegrade"}
<!--没有子栏目显示的内容-->
{eyou:notempty name='$eyou.field.has_children' /}
<!--判断当前栏目有无子栏目-->
  <div class="intereste-area">
<p class="title">栏目分类</p>
<div class="intereste-list"> 
{eyou:channel type="first" row='10' currentstyle="hover"}
<a href="{$field.typeurl}" title="{$field.typename}" class="{$field.currentstyle}">{$field.typename}</a>
{/eyou:channel}
   </div>
  </div>
<!--判断当前栏目有无子栏目 end-->
  {/eyou:notempty}
<!--没有子栏目显示的内容 end-->
{eyou:else /}
<!--有子栏目显示的内容-->
  <div class="intereste-area">
<p class="title">栏目分类</p>
<div class="intereste-list"> 
{eyou:channel type="first" row='10' currentstyle="hover"}
<a href="{$field.typeurl}" title="{$field.typename}" class="{$field.currentstyle}">{$field.typename}</a>
{/eyou:channel}
   </div>
  </div>
<!--有子栏目显示的内容 end-->
{/eyou:empty}

 

标签:栏目,易优,顶级,有子,field,eyou,channel
From: https://www.cnblogs.com/hwrex/p/18299792

相关文章