注册 | 登录 |
地方论坛门户及新闻和人才网址大全

织梦让channelartlist标签支持currentstyle高亮属性方法

时间:2021-07-21人气:-


要实现织梦让channelartlist标签支持currentstyle高亮属性方法

首先打开includetaglibchannelartlist.lib.php

找到

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

在此行代码下方增加以下代码:

if($typeids[$i]['id'] == $refObj->TypeLink->TypeInfos['id'] || $typeids[$i]['id'] == $refObj->TypeLink->TypeInfos['topid'] ){

$pv->Fields['currentstyle'] = $currentstyle ? $currentstyle : 'current';

}

else{

$pv->Fields['currentstyle'] = '';

}

添加这个后才能对二级栏目也起作用

调用方法:

{dede:channelartlist typeid='4' currentstyle='current'}

<li class='{dede:field.currentstyle/}'><a href='{dede:field name='typeurl'/}'>{dede:field name='typename'/}</a></li>

{/dede:channelartlist}



上篇:织梦会员模板调用全站head.htm模板教程

下篇:如何实现织梦CMS有短标题则显示短标题,没有则显示文章标题