dede栏目调用判断是否有子栏目
{dede:field name=typeid runphp="yes"}
{dede:field name=typeid runphp="yes"}
global $dsql;
$sql = "SELECT id From `dede_arctype` WHERE reid='@me' And ishidden<>1 order by sortrank asc limit 0, 100 ";
$row = $dsql->GetOne($sql);
@me=is_array($row)'有子栏目':'无子栏目';
{/dede:field}
完整实例
完整实例
<ul class="am-menu-nav am-avg-sm-1">
{dede:channelartlist typeid='top'}
{dede:field name=typeid runphp="yes"}
global $dsql;
$sql = "SELECT id From `dede_arctype` WHERE reid='@me' And ishidden<>1 order by sortrank asc limit 0, 100 ";
$row = $dsql->GetOne($sql);
@me=is_array($row)'<li class="am-parent">':'<li class="">';
{/dede:field}
<a href="{dede:field name='typeurl'/}" class="">{dede:field name='typename'/}</a>
{dede:channel type='son' row=1}<ul class="am-menu-sub am-collapse am-avg-sm-2 ">{/dede:channel}
{dede:channel type='son' reid=typeid}
<li class=""><a href="[field:typelink/]" class="">[field:typename/]</a></li>
{/dede:channel}
{dede:channel type='son' row=1}</ul>{/dede:channel}
</li>
{/dede:channelartlist}
</ul>