dedecms判断是否有子栏目
作者:互联网
dedecms判断是否有子栏目。代码如下:
{dede:channelartlist row='8' typeid='top'} <li class="main_item "> <a href="{dede:field name=typeid runphp=yes}global $dsql;$row = $dsql->GetOne("select * from `#@_arctype` where reid='@me' and ishidden<>1 order by sortrank asc limit 0,1");if(is_array($row)) @me = 'javascript:;'; else @me = GetOneTypeUrlA($dsql->GetOne("select * from `#@_arctype` where id='@me' and ishidden<>1"));{/dede:field}"><span>{dede:field name='typename'/}</span></a> <ul {dede:field name=typeid runphp="yes"} global $dsql; $sql = "SELECT id From `#@_arctype` WHERE reid='@me' And ishidden<>1 order by sortrank asc limit 0, 100 "; $row = $dsql->GetOne($sql); @me=is_array($row)?'class="drop_list"':'style="display:none"'; {/dede:field}> {dede:channel type='son' noself='yes'} <li><a class="novlink" href="https://www.360muye.cn/[field:typelink/]" title="[field:typename/]">[field:typename/]</a></li> {/dede:channel} </ul> </li> {/dede:channelartlist}
上面的代码实现,如果有子栏目,就调用:
<ul class="drop_list"> {dede:channel type='son' noself='yes'} <li><a class="novlink" href="https://www.360muye.cn/[field:typelink/]" title="[field:typename/]">[field:typename/]</a></li> {/dede:channel} </ul>
标签:me,栏目,有子,dedecms,field,dede,channel,row 来源: https://www.cnblogs.com/fymuban/p/14845740.html