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 ...
随机推荐
- Eric Linux - 1 Basic concepts of linux
Computer basic Computer 5 parts CPU Input Output Memory External storage device. CPU RISC: Reduced I ...
- 大数据基础之Kafka(1)简介、安装及使用
kafka2.0 http://kafka.apache.org 一 简介 Kafka® is used for building real-time data pipelines and strea ...
- 使用Hibernate连接Oracle 无法识别生成的SQL问题
问题: 在JAVA工程中,数据库使用的是OracleXE(Oracle10g Express Edition). 使用hibernate.reveng.xml创建了实体类及其DAO类,如: tt.my ...
- Docker容器化部署Python应用
1. 简介 Docker是目前主流IT公司广泛接受和使用的,用于构建.管理和保护它们应用程序的工具. 容器,例如Docker允许开发人员在单个操作系统上隔离和运行多个应用程序,而不是为服务器上的每个应 ...
- HBase 学习之路(五)——HBase常用 Shell 命令
一.基本命令 打开Hbase Shell: # hbase shell 1.1 获取帮助 # 获取帮助 help # 获取命令的详细信息 help 'status' 1.2 查看服务器状态 statu ...
- VMware安装linux系统
- jsp路径兼容
jsp头 <%@ page language="java" import="java.util.*" pageEncoding="UTF-8&q ...
- Android中控件属性详细总结(转载)
转载地址:https://www.cnblogs.com/nanguojs/p/5950510.html 1.LinearLayout(线性布局): 可以分为水平线性:android:orientat ...
- LeetCode刷题------------------------------LeetCode使用介绍
临近毕业了,对技术有种热爱的我也快步入码农行业了,以前虽然在学校的ACM学习过一些算法,什么大数的阶乘,dp,背包等,但是现在早就忘在脑袋后了,哈哈,原谅我是一枚菜鸡,为了锻炼编程能力还是去刷刷Lee ...
- scala刷LeetCode--26 删除排序数组中的重复项
一.题目描述 给定一个排序数组,你需要在原地删除重复出现的元素,使得每个元素只出现一次,返回移除后数组的新长度. 不要使用额外的数组空间,你必须在原地修改输入数组并在使用 O(1) 额外空间的条件下完 ...