我们在用DEDECMS建站时,常常会做二级栏目的功能,既要用到二级栏目,也就要通过DEDE标签再套标签的方式来实现调用,而DEDECMS多层标签调用只支持channelartlist,也就是说我们只能通过dede:channelartlist标签才能调出二级栏目,我们用dede:channelartlist能顺利的将信息调出来,但是如果我们要设置当前所在栏目高亮显示的功能时,currentstyle属性将不起作用,下面我们就来解决channelartlist currentstyle高亮显示的问题。

1、找到“/include/taglib/channellartlist.php”这个文件;

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="current"';}    else{    $pv->Fields['currentstyle'] = '';}

4、调用方法:{dede:channelartlist typeid='top'}<li{dede:field.currentstyle/}><a href="{dede:field name='typeurl'/}">{dede:field name='typename'/}</a></li>{/dede:channelartlist}

以上4步,完美解决dede:channelartlist标签无法使用currentstyle的问题。

另外需要注意的是<li{dede:field.currentstyle/}>这段代码中,请不要自作聪明的加上class="{dede:field.currentstyle/}",因为最先加的一段代码中就判断了,如果是当然栏目,系统就会自动输出“ class='current'”,照本文原样复制,即可解决这个问题。

dede:channelartlist currentstyle高亮显示的更多相关文章

  1. dede channelartlist 中引用channel 并且设置当前选择类的样式,currentstyle暂时没有效果.特发求助!!!!

    在dede中需要达到当前选择了该类,样式不同的话.如果是channelartlist 的话. 可以使用下面的情况: {dede:channelartlist typeid='6' row='3' cu ...

  2. 多级分类标签{dede:channelartlist}实现当前栏目颜色高亮显示

    我们知道,如果要在网站上多级分类显示的话,可以用下面的标签实现:   {dede:channelartlist typeid='4' cacheid='channelsonlist'}    < ...

  3. 织梦dede:channelartlist调用排除指定typeid栏目

    在使用 dede:channelartlist 自动调用栏目内容时,经常会遇到某些栏目不需要调用,比如“关于我们”.“联系地址”等无持续更新的栏目.要想在 dede:channelartlist 调用 ...

  4. {dede:channelartlist} 改变偶数的class

    {dede:channelartlist} <div {dede:global.itemindex runphp='yes'} if((@me %2) == 0){ @me = 'class=& ...

  5. dede让channelartlist标签支持currentstyle属性 完美解决

    打开include\taglib\channelartlist.lib.php 找到 $pv->Fields['typeurl'] = GetOneTypeUrlA($typeids[$i]); ...

  6. dede currentstyle属性完美解决方案

    问题一.dede让channelartlist标签支持currentstyle属性 完美解决 打开include\taglib\channelartlist.lib.php找到$pv->Fiel ...

  7. dedecms织梦让channelartlist标签支持currentstyle属性

    打开include\taglib\channelartlist.lib.php  大约93行 找到: $pv->Fields['typeurl'] = GetOneTypeUrlA($typei ...

  8. 织梦channelartlist标签内使用currentstyle

    找到文件\include\taglib\channelartlist.lib.php 找到代码 $pv->Fields['typeurl'] = GetOneTypeUrlA($typeids[ ...

  9. dedecms让channelartlist标签支持currentstyle属性方

    把dedecms中用channelartlist当导航的站很普遍,但是有的站需要用到当前页中导航样,就是随着不同的页面,导航样式也随着变化. 首先打开include\taglib\channelart ...

随机推荐

  1. 如何设计firemonkey的style样式

    您好,在窗体上添加一个 TStyleBook(StyleBook1), 可以载入.编辑.另存这些样式.编辑 StyleBook1 后, 可以把它直接赋给窗体的 StyleBook 属性: proced ...

  2. Codility---Brackets

    Task description A string S consisting of N characters is considered to be properly nestedif any of ...

  3. 使用pjax实现类似github无刷新更改页面url

    pjax=pushState+ajax,相信用过github的同学都知道,github部分页面采用了pjax这个项目来实现ajax无刷新加载的同时改变页面url.一起来学习一下这个插件吧. 我们都知道 ...

  4. 如何调整cookie的生命周期

    一.什么是cookie 形象比喻成“网络身份证” 指某些网站为了辨别用户身份.进行session跟踪而储存在用户本地终端上的数据(通常经过加密). (1)记录信息的盒子(2)识别每一个网络用户的证件 ...

  5. ZooKeeper学习第五期--ZooKeeper管理分布式环境中的数据(转)

    转载来源:https://www.cnblogs.com/sunddenly/p/4092654.html 引言 本节本来是要介绍ZooKeeper的实现原理,但是ZooKeeper的原理比较复杂,它 ...

  6. Unity AssetBundle,Asset,GameObject之间的联系

    一.问题 首先,这里说明一下,我这边的GameObject有点笼统,就是表达的是游戏中的具体实例. 二.概念 1)Asset是什么? 游戏中具体的资源,像texture,mesh,material,s ...

  7. Storm 学习之路(四)—— Storm集群环境搭建

    一.集群规划 这里搭建一个3节点的Storm集群:三台主机上均部署Supervisor和LogViewer服务.同时为了保证高可用,除了在hadoop001上部署主Nimbus服务外,还在hadoop ...

  8. ZooKeeper学习之路(四)—— Java 客户端 Apache Curator

    一.基本依赖 Curator是Netflix公司开源的一个Zookeeper客户端,目前由Apache进行维护.与Zookeeper原生客户端相比,Curator的抽象层次更高,功能也更加丰富,是目前 ...

  9. spring 5.x 系列第19篇 ——spring简单邮件、附件邮件、内嵌资源邮件、模板邮件发送 (xml配置方式)

    源码Gitub地址:https://github.com/heibaiying/spring-samples-for-all 一.说明 1.1 项目结构说明 邮件发送配置文件为springApplic ...

  10. nginx连接操作memcahe

    nginx配置连接操作memcache nginx配置连接memcache: location / { set $memcached_key "$uri"; #设置memcache ...