织梦默认的currentstyle是不支持typeid属性的,调用方法:
{dede:channel type='son' row='8' currentstyle="<li><a rel="nofollow noopener noreferrer" href='~typelink~'>~typename~</a> </li>"}
<li><a rel="nofollow noopener noreferrer" href='[field:typelink/]'>[field:typename/]</a> </li>
{/dede:channel}
但是很多情况下需要单独指定栏目(比如:产品下拉菜单),这时用channel里的typeid就没有效果了,需要去修改include/taglib/channel.lib.php
查找:
if( ($row['id']==$typeid || ($topid==$row['id'] && $type=='top') ) && $currentstyle!='' )
替换:
if( ( $row['id']== $refObj->TypeLink->TypeInfos['id'] || ($topid==$row['id'] && $type=='top') ) && $currentstyle!='' )
调用方法:
{dede:channel typeid ='2' type ='son' currentstyle="<li><a rel="nofollow noopener noreferrer" href='~typelink~'>~typename~</a> </li>"}
<li><a rel="nofollow noopener noreferrer" href='[field:typelink/]'>[field:typename/]</a> </li>
{/dede:channel}
本文织梦导航标签channel里的typeid无效如何解决方法到此结束。岁月,是一首诗,一首蕴含丰富哲理的诗,岁月是一峰骆驼,驮着无数人的梦想。谢谢大家支持!