如何让织梦{dede:channel type=’son’}无子栏目时不显示同级栏目呢?
方法一:
打开:include\taglib\channel.lib.php文件。
找到
if($type==’son’ && $reid!=0 && $totalRow==0)
改成
if($type==’son’ && $reid!=0 && $totalRow==0 && $noself==’’)
网上可以找到的答案也就是上面这些了,有些童鞋按照上述方法就解决了,可是有些童鞋的问题依然没有解决!
问题出在哪呢?原来是要在织梦的channel标签中加上 noself=’yes’就可以了!
{dede:channel type=’son’ row=’5’ noself=’yes’}
然后在模板中引用实例如下:
<ul>
{dede:channelartlist typeid=’10’}
<li class="li_biaoti"><a class="s" >{dede:field name=’typename’/}</a></li>
{dede:channel type=’son’ noself=’yes’}
<li><a class="t">[field:typename/]</a></li>
{/dede:channel}
{/dede:channelartlist}
</ul>
方法二:
打开:include\taglib\channel.lib.php
找到第110行,注释掉这段代码
转载于:https://blog.51cto.com/14262733/2370635