加拿大预测网-在线预测

信息动态

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

技术资讯

织梦artlist当前文章高亮

2015-05-22 00:42:15

在织梦系统中的artlist有时候需要当前文章高亮,或者和channelartlis🗹t标签套用实现当前栏目高亮和当前文章高亮,就可以通过此方法实现:

首先实现artlist当前文章高亮:

打开include\taglib\arclist.lib.php

$channelid = $ctag->GetAtt('channelid');

下增加:

$channelid = $ctag->GetAtt('channelid');

$tagid,$pagesi💧ze,$isweight 后增加  ,$currentstyle

在$n𒁏oflag='',$tagid='', $pagesize=0, $isweight='N' 后💙增加 ,$currentstyle=''

$row['textlink'] = "<a href='".$row['filename']."'>".$𝐆row['title']."</a>";

加拿大预测网-在线预测:下增加

if($currentstyle && $row['id']==$arcid){

 ♓                   $currentstyle = str_replace('~typelink~', $row['filename'], $currentstyle);

         𝓰;   &🎉nbsp;       $row['currentstyle'] = str_replace('~typename~', $row['title'], $currentstyle);

        &nbဣsp; &nbs𓄧p;     }

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

加拿大预测网-在线预测:模板调用:

{dede:arclist titlelen='42' row='10' currentstyle="<li class='🥀current' ><a href='~typelink~'>~typename~</a></li>&quo🌺t;}

加拿大预测网-在线预测:&♈nbsp;    [field:array run💙php='yes']

      &nbs🥀p;  if(@me['currentstyle']){

 🐎    𒆙;        @me = @me['currentstyle'];

加拿大预测网-在线预测:  &🍃nbsp;      }else{

          &nb🧔sp;  @me = "<li class='abc' ><a href='{@me['arcurl']}'>{@me['title']}</a></li>🍰;";

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

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

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

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

加拿大预测网-在线预测:如果和channelartlist搭配使用,方法如下:

加拿大预测网-在线预测:打开includ⛄e\taglib\channelartlist.lib.ph𒁏p

加拿大预测网-在线预测:找到

$pv->Fields[🅰'typeurl'] = GetOneT𒐪ypeUrlA($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['c♔urrentstyle'] = '';

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

网上找到的一般没有加$typeids[$i]['id'] ==$refObj->TypꦐeL꧅ink->TypeInfos['topid'] 

加拿大预测网-在线预测:添加这个后才能对二级栏目也起作用

加拿大预测网-在线预测:调用方法:

{dede:chann🌳elartlist typeid='2' currentstyle='current'}

<li class='{dede:field.currentstyle/}'><a href='{dede:field name='typeurl'/}'>{dede:field name='typename'/}</a></li&g�𒊎�t;

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

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

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

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

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

{ded🧸e:channelartlist typeid='2' cur💖rentstyle='current'}

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

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

加拿大预测网-在线预测:&꧅nbsp;    [field:array runph♑p='yes']

      &nℱbsp;  if(@me['curr♉entstyle']){

🦂             @me = @me['currentstyle'];

加拿大预测网-在线预测:  &nbs😼p;      }else{

             @me = "<dd ><a href='{@me['arcurl']}'>{@me[🌃'title']}</a></dd>🍸";

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

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

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

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

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

以上方法能够实现青岛网站建设很多树状定位结构。

 

 

 

0532-85810878 473587358 扫码添加微信

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

扫码关注公众号

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

2054585360