织梦导航菜单判断是否有子栏目,有则显示否则隐藏(二级菜单调用)
来源:未知 作者:52sheji 浏览:1405
2018/07/06 09:47:43
分享
我们在调用二级菜单的时候,会遇到这样的问题,如果有子栏目,就显示二级菜单,如果没有就不显示,下面给出代码:
{dede:channelartlist row=8 typeid='1,2,3,4,5'}
<li class="tab dropdown">
<a href="{dede:field.typeurl/}" class="tablink arwlink" title="{dede:field.typename/}">{dede:field.typename/}</a>
{dede:field name=typeid runphp="yes"}
global $dsql; $sql = "SELECT id From `qm_arctype` WHERE reid='@me' And ishidden<>1 order by sortrank asc limit 0, 100 ";
$row = $dsql->GetOne($sql);
@me=is_array($row)?'<ul class="subnav">':'';
{/dede:field}
{dede:channel type='son' noself='yes' }
<a href="[field:typeurl/]">[field:typename/]</a>
{/dede:channel}
{dede:field name=typeid runphp="yes"}
global $dsql; $sql = "SELECT id From `qm_arctype` WHERE reid='@me' And ishidden<>1 order by sortrank asc limit 0, 100 ";
$row = $dsql->GetOne($sql);
@me=is_array($row)?'</ul>':'';
{/dede:field}
</li>
{/dede:channelartlist}
关键词: 无标签
内容来源说明:本文章来自网络收集,如侵犯了你的权益,请联系QQ:进行删除。
广告位不存在!