織夢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:channelartlist}
如果是當前欄目則 li的class屬性顯示current,否則顯示class=” ,也可以修改currentstyle=’這里改為你需要的類名’。
? 版權聲明
文章版權歸作者所有,未經允許請勿轉載。
THE END