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>

 

上一篇:Python爬虫之电子书爬取


下一篇:当单片机遇到状态机(一) QP框架的入门