打开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属性 完美解决的更多相关文章

  1. 让arclist标签也支持currentstyle属性 完美解决

    1.查找到: $channelid = $ctag->GetAtt('channelid'); 在下面插入:$currentstyle = $ctag->GetAtt('currentst ...

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

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

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

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

  4. 织梦CMS让channelartlist标签支持currentstyle【转】

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

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

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

  6. DedeCMS让channelartlist支持currentstyle属性

    dedecms默认模板的channelartlist是不支持currentstyle属性的.currentstyle属性在导航中应用的比较多,可以实现循环调用栏目后,当前页<li>标签获得 ...

  7. form表单嵌套,用标签的form属性来解决表单嵌套的问题

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...

  8. 织梦dede如何获取图集调用第一张图片完美解决方法【5.7sp2版本】

    制作产品图集多图效果的时候,常常需要获取图集第一张图片的功能,假设获取的是缩略图,那么缩略图不够大的情况下,第一展示效果就会很差,下面来介绍下如何获取调用织梦图集第一张图片的方法: 首先在 inclu ...

  9. dede织梦 arclist标签完美支持currentstyle属性

    由于客户需求,所以进行对文章的arclist标签进行设置当前样式(currentstyle),修改前记得备份. dede版本v5.7sp 找到PHP修改: include/taglib/arclist ...

随机推荐

  1. Idea_Maven配置

    操作方式:在install上右键——>Run***install 出现Run Configurations ——>右键——>Edit Run Configuration 1.Inst ...

  2. The constructor BASE64Encoder() is not accessible due to restriction on required

    在Eclipse中编写Java代码时,用到了BASE64Decoder,import sun.misc.BASE64Decoder;可是Eclipse提示: Access restriction : ...

  3. Git Shell 安装版本

    #!/bin/sh v1.; do echo "Begin install Git $ver."; git reset --hard git clean -fdx git chec ...

  4. C#操作XML(读XML,写XML,更新,删除节点,与dataset结合等)【转载】

    已知有一个XML文件(bookstore.xml)如下: Corets, Eva 5.95 1.插入节点 往节点中插入一个节点: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ...

  5. winform学习1-----理解小概念-20160506

    panel属性,dock:获取或设置控件停靠到父容器的哪一个边缘. none,right,left,fill(完全填充),top C#默认窗体大小设置:maximumsize 窗体最大值 minimu ...

  6. 转 sql 时间转换格式 convert(varchar(10),字段名,转换格式)

    convert(varchar(10),字段名,转换格式) CONVERT(nvarchar(10),count_time,121)CONVERT为日期转换函数,一般就是在时间类型(datetime, ...

  7. 移动端JD首页H5页面

    1:理解View :<meta name="viewport" content="width=device-width,initial-scale=1.0" ...

  8. Intent学习笔记

    Intent首先字面意思大概是意图.负责activity之间或者,activity与service等(我只知道这么点)之间信息的传递.就跟快递员起的作用差不多(我这这么理解),由一下六部分组成: Co ...

  9. iOS segue 跳转

    场景描述: 要实现在tableViewController 的界面A里,点击一个cell ,跳转到第二个viewController的界面B .在第二个界面里做相应操作. 我的做法,利用sb,在A 里 ...

  10. 2016.03.31,英语,《Vocabulary Builder》Unit 08

    tend/tent: from the Latin tendere, meaning 'to stretch, extend, or spread'. tent: [tent] n. 帐篷 vt.&a ...