### [织梦cms调取栏目高亮特殊样式的限制字节方法](https://www.prosaas.cn/article/8130) **Published:** 2019-11-28T03:56:15 **Author:** 5201314 **Excerpt:** 目前织梦模板里currentstyle只支持dede:channel,这种只能调取一层栏目,而我们建站时,在导… 目前织梦模板里currentstyle只支持dede:channel,这种只能调取一层栏目,而我们建站时,在导航栏里经常要调用到一级和二级栏目,然后让当前栏目高亮,使用特殊样式,要用到dede:channelartlist。 ![](//zhiqipro.oss-cn-beijing.aliyuncs.com/2023/12/20231212130902698.jpg) **现在的织梦currentstyle在dede:channelartlist里中无法使用的,需要我们自己添加一些代码才行。** 1、找到“/include/taglib/channelartlist.lib.php”这个文件;          【推荐学习:织梦cms】 2、找到这行代码“$pv->Fields\['typeurl'\] = GetOneTypeUrlA($typeids\[$i\]);” 3、在这行代码后复制以下代码: if($typeids\[$i\]\['id'\] == $refObj->TypeLink->TypeInfos\['id'\] || $typeids\[$i\]\['id'\] == $refObj->TypeLink->TypeInfos\['topid'\] ){ $pv->Fields\['currentstyle'\] = $currentstyle ? $currentstyle : ' class="on"';} else{ $pv->Fields\['currentstyle'\] = '';} 4、调用方法: {dede:channelartlist typeid='top'}{dede:field name='typename'/}{/dede:channelartlist} 这样就可以在调取所有栏目的dede:channelartlist标签里使用currentstyle了。 其中:3、里面的 class="on" 就是在当前栏目里加的样式,可以把on修改为自己想要的。 以上就是织梦cms调取栏目高亮特殊样式的限制字节方法的详细内容,更多请关注知企PROSAAS其它相关文章! **Categories:** DEDECMS ---