Home >CMS Tutorial >DEDECMS >How does Dreamweaver dede make the channelartlist tag support the currentstyle attribute?
How to make the channelartlist tag support the currentstyle attribute?
DreamWeaver dede allows the channelartlist tag to support the currentstyle attribute
Recommended learning: Dreamweaver cms
Open include\taglib\channelartlist.lib .php
Find
$pv->Fields['typeurl'] = GetOneTypeUrlA($typeids[$i]);
Add the following code below this line of code:
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'] = ''; }
Calling method:
{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}
If it is the current column, then the class of li The attribute displays current, otherwise class='' is displayed. You can also modify currentstyle='change this to the class name you need'.
The above is the detailed content of How does Dreamweaver dede make the channelartlist tag support the currentstyle attribute?. For more information, please follow other related articles on the PHP Chinese website!