dede:channelartlist currentstyle高亮显示
我们在用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高亮显示的更多相关文章
- dede channelartlist 中引用channel 并且设置当前选择类的样式,currentstyle暂时没有效果.特发求助!!!!
在dede中需要达到当前选择了该类,样式不同的话.如果是channelartlist 的话. 可以使用下面的情况: {dede:channelartlist typeid='6' row='3' cu ...
- 多级分类标签{dede:channelartlist}实现当前栏目颜色高亮显示
我们知道,如果要在网站上多级分类显示的话,可以用下面的标签实现: {dede:channelartlist typeid='4' cacheid='channelsonlist'} < ...
- 织梦dede:channelartlist调用排除指定typeid栏目
在使用 dede:channelartlist 自动调用栏目内容时,经常会遇到某些栏目不需要调用,比如“关于我们”.“联系地址”等无持续更新的栏目.要想在 dede:channelartlist 调用 ...
- {dede:channelartlist} 改变偶数的class
{dede:channelartlist} <div {dede:global.itemindex runphp='yes'} if((@me %2) == 0){ @me = 'class=& ...
- dede让channelartlist标签支持currentstyle属性 完美解决
打开include\taglib\channelartlist.lib.php 找到 $pv->Fields['typeurl'] = GetOneTypeUrlA($typeids[$i]); ...
- dede currentstyle属性完美解决方案
问题一.dede让channelartlist标签支持currentstyle属性 完美解决 打开include\taglib\channelartlist.lib.php找到$pv->Fiel ...
- dedecms织梦让channelartlist标签支持currentstyle属性
打开include\taglib\channelartlist.lib.php 大约93行 找到: $pv->Fields['typeurl'] = GetOneTypeUrlA($typei ...
- 织梦channelartlist标签内使用currentstyle
找到文件\include\taglib\channelartlist.lib.php 找到代码 $pv->Fields['typeurl'] = GetOneTypeUrlA($typeids[ ...
- dedecms让channelartlist标签支持currentstyle属性方
把dedecms中用channelartlist当导航的站很普遍,但是有的站需要用到当前页中导航样,就是随着不同的页面,导航样式也随着变化. 首先打开include\taglib\channelart ...
随机推荐
- python常用数据结构(2)
1.有名字的元组——namedtuple >>> from collections import namedtuple >>> Point = namedtuple ...
- mpvue 小程序加载不了图片 Error: Failed to load local image resource /images/xx.png the server responded with a status of 404 (HTTP/1.1 404 Not Found)
mpvue开发小程序时候,要添加静态本地图片 <img src="../../images/bg.png" alt=""> 会报错: VM14878 ...
- Python基础,day2
程序练习 程序:购物车程序 需求: 启动程序后,让用户输入工资,然后打印商品列表 允许用户根据商品编号购买商品 用户选择商品后,检测余额是否够,够就直接扣款,不够就提醒 可随时退出,退出时,打印已购买 ...
- 关于linux网卡消失的问题
首先我也是一名学生,在学习的过程Linux的过程中,因为老师要求配置hadoop集群所以就匆匆忙忙的上手了,但是在配置网络的问题时遇到了网卡消失的问题 我在网上询问了许多的人,但是还是没有找到一个很好 ...
- MCtalk对话学吧课堂:真正的K12在线教育才刚刚开始
课堂之外的在线教育已经被大部分家庭所熟知,既涌现出了VIPKID等行业独角兽,也有大量致力于科技改变教育的新兴机构获得了快速成长.成立于2014年的学吧课堂就是专注在K12在线教育领域的创新机构,他们 ...
- Scala 学习之路(九)—— 继承和特质
一.继承 1.1 Scala中的继承结构 Scala中继承关系如下图: Any是整个继承关系的根节点: AnyRef包含Scala Classes和Java Classes,等价于Java中的java ...
- python算法与数据结构-栈(43)
一.栈的介绍 栈作为一种数据结构,是一种只能在一端进行插入和删除操作.它按照先进后出的原则存储数据,先进入的数据被压入栈底,最后的数据在栈顶,需要读数据的时候从栈顶开始弹出数据(最后一个数据被第一个读 ...
- 【Mysql】重启: mysql.service: Service hold-off time over, scheduling restart.
参考链接:http://sharong.iteye.com/blog/2262760 重启mysql服务器 (/etc/init.d/mysql stop /etc/init.d/mysql sta ...
- yii中find()指定条件
find()查找指定的条件 $modelName::model->find(); 使用条件对象 $criteria = new CDbCriteria(); $criteria->sele ...
- yii中常用路径
//YII framework路径Yii::getFrameworkPath(); //protected/runtimeYii::app()->getRuntimePath(); //在vie ...