DedeCMS织梦判断是否有二级栏目输出不同链接

创客云

DedeCMS织梦判断是否有子栏目,有就输出 javascript:; ,没有子栏目就直接输出一级栏目的链接。

  1. {dede:channelartlist row=7 typeid=top currentstyle=current}
  2. <li>
  3. 	<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.typename/}</span>{dede:channel type='son' row=1 noself='yes'}<i class="touch-arrow-down"></i>{/dede:channel}</a>
  4. 	{dede:channel type='son' row=1 noself='yes'}
  5. 	<ul>
  6. 	{/dede:channel}
  7. 		{dede:channel type='son' noself='yes'}
  8. 		<li><a href="[field:typelink/]"><span>[field:typename/]</span></a></li>
  9. 		{/dede:channel}
  10. 	{dede:channel type='son' row=1 noself='yes'}
  11. 	</ul>
  12. 	{/dede:channel}
  13. </li>
  14. {/dede:channelartlist}
本文由 CityMall 整理发布如需转载,请注明出处:https://www.22vd.com/60360.html
云模板

发表评论