织梦默认的currentstyle是不支持typeid属性的,调用方法:
{dede:channel type='son' row='8' currentstyle="<li><a href='~typelink~'>~typename~</a> </li>"}
<li><a 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 href='~typelink~'>~typename~</a> </li>"}
<li><a href='[field:typelink/]'>[field:typename/]</a> </li>
{/dede:channel}