织梦channelartlist标签内使用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='cur'}
    <li class="{dede:field.currentstyle/}">{dede:field name='typename'/}</li>
{/dede:channelartlist}

 

posted @ 2019-02-23 15:22  bubuchu  阅读(178)  评论(0编辑  收藏  举报