{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}上述代码红色部分就是判断是否隐藏二级栏目的代码,其判断为有子栏目时就显示,没有有子栏目时就隐藏。