dedecms默認模板的channelartlist是不支持currentstyle屬性的。currentstyle屬性在導航中應用的比較多,可以實現循環調用欄目后,當前頁
$pv->Fields['typeurl'] = GetOneTypeUrlA($typeids[$i]); |
//讓channelarclist支持currentstyle屬性 if($typeids[$i]['id'] == $refObj->TypeLink->TypeInfos['id'] || $typeids[$i]['id'] == $refObj->TypeLink->TypeInfos['topid'] ){ $pv->Fields['currentstyle'] = $currentstyle ? $currentstyle : 'nLi on'; } else{ $pv->Fields['currentstyle'] = 'nLi'; } //讓channelarclist支持currentstyle屬性end |
{dede:channelartlist typeid='2' currentstyle='current'}<li class='{dede:field.currentstyle/}'><a href='{dede:field name='typeurl'/}'>{dede:field name='typename'/}</a></li>。。。{/dede:channelartlist} |
新聞熱點
疑難解答