織夢dede如何讓channelartlist標簽支持currentstyle屬性

織夢dede如何讓channelartlist標簽支持currentstyle屬性

織夢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=’這里改為你需要的類名’。

    ? 版權聲明
    THE END
    喜歡就支持一下吧
    點贊5 分享