DedeCMS让channelartlist支持currentstyle属性
打开includ
更多精彩就在: 51免费论文网|www.jxszl.com
e aglibchannelartlist.lib.php
找到:
$pv->Fields[typeurl]=GetOneTypeUrlA($typeids[$i]);
在此行代码下方增加以下代码:
//让channelarclist支持currentstyle属性if($typeids[$i][id]==$refObj->TypeLink->TypeInfos[id]||$typeids[$i][id]==$refObj->TypeLink->TypeInfos[topid]){$pv->Fields[currentstyle]=$currentstyle?$currentstyle:nLion;}else{$pv->Fields[currentstyle]=nLi;}//让channelarclist支持currentstyle属性end
网上找到的I.般没有加$typeids[$i][id]==$refObj->TypeLink->TypeInfos[topid]
添加这个后才能对II级栏目也起作用.
调用方法:
{dede:channelartlisttypeid=IIcurrentstyle=current}
如果是当前栏目则li的class属性显示current,否则显示class=,也可以修改currentstyle=这里改为你需要的类名.
导航用channelartlist调用子栏目方法
- {dede:channeltype=sonnoself=yes}
[field:typename/] {/dede:channel}
循环调用出的栏目
配合使用SuperSlide可以构建美观的下拉菜单功能
具体的方法可以参考官方的使用方法,我使用的时候发现,手动或后台程序添加titOnClassName类名(默认是on),相当于设置参数defaultIndex:II.若同时设置参数returnDefault:true,则鼠标移走后返回当前频道."这个功能失效,更新后才能正常使用,但是I.定要按照以上步骤进行修改才能让channelartlist支持currentstyle属性.下面附修改方法:
include aglibchannelartlist.lib.php部分修改为
if($typeids[$i][id]==$refObj->TypeLink->TypeInfos[id]||$typeids[$i][id]==$refObj->TypeLink->TypeInfos[topid]){$pv->Fields[currentstyle]=$currentstyle?$currentstyle:nLion;}else{$pv->Fields[currentstyle]=nLi;
后台调用部分修改为:
- {dede:channeltype=sonnoself=yes}
[field:typename/] {/dede:channel}
原文链接:http://www.jxszl.com/biancheng/dedecms/74146.html
最新推荐
热门阅读