{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}
这种调用方式导航高亮currentstyle有效
但是,这种指定了typeid的调用方式,导航高亮currentstyle就无效了
{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!='' )
最后,要特别注意调用的时候,class='thisclass',用的是单引号,不是双引号。
原创文章请注明转载自霍者博客本文地址:http://www.huozheweb.com/post/611.html,标题:DEDECMS channel标签指定typeid时,导航高亮currentstyle无效的修复办法