经测试,在channelartist标签中,直接调用{dede:field.currentstyle/}是无效的,需要更改一个文件。

在include/taglib下的channelartlist.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='top' currentstyle='active'}

....

{dede:field.currentstyle/}

...

 {/dede:channelartlist}

具体实例


{dede:channelartlist typeid='top' currentstyle='active'}
<li class="{dede:field.currentstyle/}"><a href="{dede:field name='typeurl'/}">{dede:field name='typename'/}</a></li>
 {/dede:channelartlist}

这样使用了