织梦dedecms使用artlist标签显示当前文章高亮

织梦dedecms使用artlist标签显示当前文章高亮,第1张

概述在织梦系统中的artlist有时候需要当前文章高亮,或者和channelartlist标签套用实现当前栏目高亮和当前文章高亮,就可以通过此方法实现: 首先实现artlist当前文章高亮: 打开include\taglib\arclist.lib.php 在 $channelid = $ctag-GetAtt('channelid'); 下

在织梦系统中的artList有时候需要当前文章高亮,或者和channelartList标签套用实现当前栏目高亮和当前文章高亮,就可以通过此方法实现:
首先实现artList当前文章高亮:
打开include\taglib\arcList.lib.PHP

GetAtt('channelID');
下增加:
GetAtt('currentstyle');

后增加 

后增加 


下增加
模板调用:
如果和channelartList搭配使用,方法如下:
打开include\taglib\channelartList.lib.PHP
找到
FIElds['typeurl'] = GetoneTypeUrlA($typeIDs[$i]);
在此行代码下方增加以下代码:
Typelink->TypeInfos['ID'] || $typeIDs[$i]['ID'] == $refObj->Typelink->TypeInfos['topID'] ){            $pv->FIElds['currentstyle'] = $currentstyle ? $currentstyle : 'current';        }        else{            $pv->FIElds['currentstyle'] = '';        }
网上找到的一般没有加$typeIDs[$i]['ID'] ==$refObj->Typelink->TypeInfos['topID'] 
添加这个后才能对二级栏目也起作用
调用方法:
如果是当前栏目则 li的class属性显示current,否则显示class='' ,也可以修改currentstyle='这里改为你需要的类名'。
这样调用:
          总结       

以上是内存溢出为你收集整理的织梦dedecms使用artlist标签显示当前文章高亮全部内容,希望文章能够帮你解决织梦dedecms使用artlist标签显示当前文章高亮所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zz/1009957.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-22
下一篇 2022-05-22

发表评论

登录后才能评论

评论列表(0条)

保存