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

(图1)

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

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

推荐学习:织梦cms

打开includetaglibchannelartlist.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'] = '';
        }

调用方法:

{dede:channelartlist typeid='2' currentstyle='current'}
  • {dede:field name='typename'/}
  • {/dede:channelartlist}

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

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

    1、本站目前拥有近 1000+ 精品收费资源,现在加入VIP会员即可全部下载。
    2、本资源部分来源其他付费资源平台或互联网收集,如有侵权请联系及时处理。
    SEA模板网 » 织梦dede如何让channelartlist标签支持currentstyle属性

    发表评论

    加入本站VIP会员订阅计划,海量资源免费查看

    目前为止共有 3654 位优秀的VIP会员加入! 立刻加入VIP会员