织梦dede:channel标签指定typeid时currentstyle无效的解决方法

2017-04-13 20:59:09 dedecms
有效示例: {dede:channel type='son' row='8' currentstyle="<li><a href='~typelink~' class='thisclass'>~typename~</a> </li>"} <li><a href='[field:typelink/]'>[field:typename/]</a> </li> {/dede:channel} 无效示例: {dede:channel type='son' row='8' 

typeid=1

 currentstyle="<li><a href='~typelink~' class='thisclass'>~typename~</a> </li>"} <li><a href='[field:typelink/]'>[field:typename/]</a> </li> {/dede:channel} 解决办法: 打开

 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!='' )