织梦channelartlist让嵌套标签里的channel也支持currentstyle高亮

嵌套标签

<div class="nav">
    <ul>
        {dede:channelartlist row=7 typeid=top currentstyle=current}
        <li class="{dede:field.currentstyle/}">
            <a href="{dede:field.typeurl/}">{dede:field.typename/}</a>
            <ul>
                {dede:channel type='son' noself='yes' row='10' currentstyle="<li class='hover'><a href='~typelink~'>~typename~</a></li>"}
                <li><a href="[field:typeurl/]">[field:typename/]</a></li>
                {/dede:channel}
            </ul>
        </li>
        {/dede:channelartlist}
    </ul>
</div>

实现教程

打开 include\taglib\channel.lib.php 找到

global $dsql;

改成

global $dsql,$_sys_globals;

继续找到

$row['id']==$typeid

改成

$row['id']==$typeid || $row['id']==$_sys_globals['typeid']

猜你喜欢

转载自www.cnblogs.com/dedevip/p/9901141.html