POST TIME:2019-09-29 14:47
dedecms模板中使用channel 標(biāo)簽中為其指定typeid時(shí) currentstyle無(wú)效的解決方法:
{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}
這種調(diào)用方式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}
這種調(diào)用方式currentstyle就無(wú)效了
論壇里有人說(shuō)用把typeid=xxx改成channelid=1,簡(jiǎn)直是無(wú)稽之談。
完美解決辦法:
本部分設(shè)定了隱藏,您已回復(fù)過(guò)了,以下是隱藏的內(nèi)容
修改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!=” )