加拿大预测网-在线预测

信息动态

网站设计是技术与创意的完美融合!

技术资讯

dede让channelartlist标签支持currentstyle属性

2013-02-24 16:58:56

dede让channelartlist标签支持currentstyle属性

打开include\taglib\channelartlist.lib.php

找到

$pv->Field🍌s['typeurl'] = GetO𝔉neTypeUrlA($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'] = ''⛦;

        }

 

网上找到的一般没有加$type๊ids[$i]['id'] ==$refObj->TypeLink->TypeInfos['topid']&nb🐎sp;

添加这个后才能对二级栏目也起作用

调用方法:

 

{dede:channelartlist 🌳typeid='2' currentstyle𒅌='current'}

<li class='{dede:field.currentstyle/}'><a href='{dede:fiꦚeld name='typeurl'/}'>{dede:field name='typename'/}</a></li&g𓆉t;

加拿大预测网-在线预测:。。。

加拿大预测网-在线预测:{/dede:channelartlist}

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

-----------------------------༺--------------------------------------------------------------------------------------------

也可以与arclist标签(详见://www.ifreew.com/a/ym/Dedecms/9191🦄.html🌠)相结合使用,

加拿大预测网-在线预测:这样调用:

{dede:c🉐hannelartlist typei꧋d='2' currentstyle='current'}

<dt ><a class='{dede:field.currentstyle/}' href='{dede:fieldname='typeurl'/}'&♚gt;{dede:field name='typename'/}</a></dt&🅷gt;

{dede:arclist titlelen='42' row='1❀0' currentstyle="<dd><a class='current' href='~typelink~'>~typename~</a></dd>"}

加拿大预测网-在线预测:    &n𒁏bsp;[field:array runphp='yes']

    &nb🔴sp;    if(@me['curr🦄entstyle']){

             @me = @me['currents🅘tyle'];

加拿大预测网-在线预测:      &nb♓sp;  }elsಌe{

            &n🎀bsp;@me = "<dd ><a href='{@me['arcurl']}'>{@me['title']}&lꦓt;/a></dd>";

加拿大预测网-在线预测:         }

加拿大预测网-在线预测:     [/field:array]

加拿大预测网-在线预测:{/dede:arclist}

加拿大预测网-在线预测:{/dede:channelartlist}

0532-85810878 473587358 扫码添加微信

加拿大预测网-在线预测:扫码添加微信

扫码关注公众号

加拿大预测网-在线预测:官方公众号

2054585360