織夢(mèng)dedecms讓channelartlist標(biāo)簽里的channel支持currentstyle當(dāng)前欄目高亮

織夢(mèng)dedecms讓channelartlist標(biāo)簽里的channel支持currentstyle當(dāng)前欄目高亮

打開 /include/taglib/channelartlist.lib.php 找到

$pv->Fields['typeurl'] = GetOneTypeUrlA($typeids[$i]);

大約在93行,在它下面添加

if($typeids[$i]['id'] == $refObj->TypeLink->TypeInfos['id'] || $typeids[$i]['id'] == $refObj->TypeLink->TypeInfos['reid'] || $typeids[$i]['id'] == $refObj->TypeLink->TypeInfos['topid'] || $typeids[$i]['id'] == GetTopid($refObj->TypeLink->TypeInfos['id']) )
{
	$pv->Fields['currentstyle'] = $currentstyle ? $currentstyle : 'current';
}
else
{
	$pv->Fields['currentstyle'] = '';
}

 

織夢(mèng)標(biāo)簽channelartlist默認(rèn)是不支持多層嵌套后使用currentstyle高亮,修改一個(gè)文件可以實(shí)現(xiàn),模板里調(diào)用代碼:里面的hover就是你的高亮樣式,

<div class="nav">
    <ul>
        {dede:channelartlist row=7 typeid=top currentstyle=hover}
        <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;

繼續(xù)搜索

$row['id']==$typeid

修改成:

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

 

 

 

 

 

THE END
亚洲中文色欧另类欧美,久久久久久久激情,亚洲 日韩 欧美 另类 国产,中文字幕高清无码男人的天堂 www.sucaiwu.net