do Dream weaving template When calling column content with channelartlist tag on the homepage or channel cover, we need to use currentstyle to highlight the current content, just like the navigation menu. Here's how to achieve this effect:

First find and open the include aglibchannelartlist.lib.php file, and find the following code in it:

$pv->Fields['typeurl'] = GetOneTypeUrlA($typeids[$i]);

Add the following code below it:

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'] = '';
}

Example of calling method in template:

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

Note: If it is the current column, the class attribute of the litag is current. Otherwise, it is empty. You can also modify currentstyle='Change it here to the name of the CSS style you need '.

Post reply

Can't comment until