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 '.
Statement: All articles on this site, unless otherwise specified or marked, are originally published on this site. No individual or organization is allowed to copy, embezzle, collect and publish the content of this website to any website, book and other media platforms without the consent of this website. If the content of this website infringes upon the legitimate rights and interests of the original author, please contact us for handling.