dede让channelartlist标签支持currentstyle属性 完美解决
打开include\taglib\channelartlist.lib.php
找到
$pv->Fields['typeurl'] =
GetOneTypeUrlA($typeids[$i]);
在此行代码下方增加以下代码:
if($typeids[$i]['id'] ==
$refObj->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']
添加这个后才能对二级栏目也起作用
调用方法:
{dede:channelartlist typeid='2'
currentstyle='current'}
<li class='{dede:field.currentstyle/}'><a
href='{dede:field name='typeurl'/}'>{dede:field
name='typename'/}</a></li>
。。。
{/dede:channelartlist}
如果是当前栏目则 li的class属性显示current,否则显示class=''
,也可以修改currentstyle='这里改为你需要的类名'。
-------------------------------------------------------------------------------------------------------------------------
也可以与arclist标签(详见:http://www.ifreew.com/a/ym/Dedecms/9191.html)相结合使用,
这样调用:
{dede:channelartlist typeid='2'
currentstyle='current'}
<dt ><a
class='{dede:field.currentstyle/}'
href='{dede:fieldname='typeurl'/}'>{dede:field
name='typename'/}</a></dt>
{dede:arclist titlelen='42' row='10'
current}
[field:array runphp='yes']
if(@me['currentstyle']){
@me = @me['currentstyle'];
}else{
@me = "<dd ><a
href='{@me['arcurl']}'>{@me['title']}</a></dd>";
}
[/field:array]
{/dede:arclist}
{/dede:channelartlist}
dede让channelartlist标签支持currentstyle属性 完美解决的更多相关文章
- 让arclist标签也支持currentstyle属性 完美解决
1.查找到: $channelid = $ctag->GetAtt('channelid'); 在下面插入:$currentstyle = $ctag->GetAtt('currentst ...
- dedecms织梦让channelartlist标签支持currentstyle属性
打开include\taglib\channelartlist.lib.php 大约93行 找到: $pv->Fields['typeurl'] = GetOneTypeUrlA($typei ...
- dedecms让channelartlist标签支持currentstyle属性方
把dedecms中用channelartlist当导航的站很普遍,但是有的站需要用到当前页中导航样,就是随着不同的页面,导航样式也随着变化. 首先打开include\taglib\channelart ...
- 织梦CMS让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属性
dedecms默认模板的channelartlist是不支持currentstyle属性的.currentstyle属性在导航中应用的比较多,可以实现循环调用栏目后,当前页<li>标签获得 ...
- form表单嵌套,用标签的form属性来解决表单嵌套的问题
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...
- 织梦dede如何获取图集调用第一张图片完美解决方法【5.7sp2版本】
制作产品图集多图效果的时候,常常需要获取图集第一张图片的功能,假设获取的是缩略图,那么缩略图不够大的情况下,第一展示效果就会很差,下面来介绍下如何获取调用织梦图集第一张图片的方法: 首先在 inclu ...
- dede织梦 arclist标签完美支持currentstyle属性
由于客户需求,所以进行对文章的arclist标签进行设置当前样式(currentstyle),修改前记得备份. dede版本v5.7sp 找到PHP修改: include/taglib/arclist ...
随机推荐
- java 实现数据结构之队列
队列是一种特殊的线性表,它只允许在表的前端(front)进行删除操作,只允许在表的后端(rear)进行插入操作. 1.队列的顺序存储结构及实现 public class SequenceQueue&l ...
- SparkContext.setCheckpointDir()
class SparkContext extends Logging with ExecutorAllocationClient Main entry point for Spark function ...
- cookie 用户第一次访问时执行
<script type="text/javascript" src="/js/jquery.Cookies.js"></script> ...
- ThinkPHP之APP_DEBUG给我带来的问题
1.刚开始学习Thinkphp,在模块分组之后,自己配置了模块分组后,发现打不开网页了,分组配置如图 2.问题现象如图 在处理空模块时写的函数也不能运行 这时我很困惑,一直检查自己的拼写和配置没发现错 ...
- HDU 1542 Atlantis(线段树扫描线+离散化求面积的并)
Atlantis Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total S ...
- 校内OJ 1128 词链(link)(Trie+DFS)
1128: 词链(link) 时间限制: 1 Sec 内存限制: 64 MB 提交: 23 解决: 7 [提交][状态][讨论版] 题目描述 给定一个仅包含小写字母的英文单词表,其中每个单词最多包 ...
- Archlinux 简明安装指南
archlinux是在distrowatch里位于top 10的发行版中,唯一采用roll release的distribution. pacman和yaourt双剑合壁,使得在archlinux安装 ...
- Ubuntu 安装搜狗拼音及fcitx
首先卸载原有ibus输入源: sudo apt-get remove ibus System Settings -> Software & Updates -> Other Sof ...
- PHP 错误与异常 笔记与总结(16 )自定义异常处理器
可以使用自定义异常处理器来处理所有未捕获的异常(没有用 try/catch 捕获的异常). set_exception_handler():设置一个用户定义的异常处理函数,当一个未捕获的异常发生时所调 ...
- MySQL存储引擎总结
MySQL存储引擎总结 作者:果冻想 字体:[增加 减小] 类型:转载 这篇文章主要介绍了MySQL存储引擎总结,本文讲解了什么是存储引擎.MyISAM.InnoDB.MEMORY.MERGE等内 ...