织梦dede如何让channelartlist标签支持currentstyle属性

来源:undefined 2024-12-29 10:52:41 1046

织梦dede如何让channelartlist标签支持currentstyle属性?

织梦dede让channelartlist标签支持currentstyle属性

推荐学习:织梦cms

打开include aglibchannelartlist.lib.php

找到

1

$pv->Fields[typeurl] = GetOneTypeUrlA($typeids[$i]);

登录后复制

在此行代码下方增加以下代码:

1

2

3

4

5

6

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] = ;

}

登录后复制

调用方法:

1

{dede:channelartlist typeid=2 currentstyle=current}

登录后复制
{dede:field name=typename/} {/dede:channelartlist}

如果是当前栏目则 li的class属性显示current,否则显示class= ,也可以修改currentstyle=这里改为你需要的类名。

以上就是织梦dede如何让channelartlist标签支持currentstyle属性的详细内容,更多请关注php中文网其它相关文章!

最新文章