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 ...
- edtftpj让Java上传FTP文件支持断点续传
在用Java实现FTP上传文件功能时,特别是上传大文件的时候,可以需要这样的功能:程序在上传的过程中意外终止了,文件传了一大半,想从断掉了地方继续传:或者想做类似迅雷下载类似的功能,文件太大,今天传一 ...
- Quartz与Spring整合进行热部署的实现(一)
先来几张实现图 任务管理页 新建任务管理.目前实现叫简单的需求...若各位同学要实现复杂的设计...quartz都有提供强大的支持.小弟目前的需求做到这已经够用了. 接下来.我们如何实现quartz的 ...
- C# - JSON操作
Newtonsoft.dll插件 http://download.csdn.net/detail/xinping_168/4710720 洪大师二次封装: using System; using Sy ...
- lucene索引日期和数字
1.用途. 索引数字的场景主要有两种:一是把它们当作字符串一样处理,比如“要是搁以前,术士能暴击10000多,有木有!”中的"10000",它和其它的词没什么区别,你可以把它仅仅想 ...
- NBOJv2 1050 Just Go(线段树/树状数组区间更新单点查询)
Problem 1050: Just Go Time Limits: 3000 MS Memory Limits: 65536 KB 64-bit interger IO format: % ...
- FZU 2032 高精度小数加法
题目描写很没意思..就是说给出n个小数 求它们的总和 因为给出的小数点后最多16位而要求保存至12位 而能直接使用的最精确的double只能到12位 于是13的进位可能被忽略 于是不可以用double ...
- [ZZ] 基于DirectX shader的Per-pixel lighting实现
这个特效需要用到DX11 UAV吗? http://blog.tianya.cn/blogger/post_show.asp?BlogID=510979&PostID=5665974 Intr ...
- php获取某年某月的天数 【转】
function days_in_month($month, $year) { // calculate number of days in a month return $month == 2 ? ...
- LoadRunner系统架构简介
1.LoadRunner系统架构简介 LoadRunner是通过创建虚拟用户来代替真实实际用户来操作客户端软件比如Internet Explorer,来向IIS.Apache等Web服务器发送HTTP ...