dedecms织梦让嵌套标签里的currentstyle高亮

dede:channelartlist栏目高亮实现教程
打开 /include/taglib/channelartlist.lib.php 找到

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

在它下面加入

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'] = '';
}

然后 dede:channelartlist 标签里是高亮标签调用是

{dede:field.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>

channelartlist嵌套channel标签也高亮实现教程
打开 /include/taglib/channel.lib.php 找到

global $dsql;

改成

global $dsql,$_sys_globals;

继续找到

$row['id']==$typeid

改成

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值