Home > Article > CMS Tutorial > The method of restricting bytes in the column highlighting special style in Dreamweaver CMS
Currently, currentstyle in the Dream Weaver template only supports dede:channel, which can only call one level of columns. When we build a website, we often need to call the first and second level columns in the navigation bar, and then make the current column higher Bright, use special style, use dede:channelartlist.
The current style of DreamWeaver cannot be used in dede:channelartlist. We need to add some code ourselves.
1. Find the file “/include/taglib/channelartlist.lib.php”; This line of code "$pv->Fields['typeurl'] = GetOneTypeUrlA($typeids[$i]);" 3. Copy the following code after this line of code:
if($typeids[$i]['id'] == $refObj->TypeLink->TypeInfos['id'] || $typeids[$i]['id'] == $refObj->TypeLink->TypeInfos['topid'] ){ $pv->Fields['currentstyle'] = $currentstyle ? $currentstyle : ' class="on"';} else{ $pv->Fields['currentstyle'] = '';}
4. Calling method:
{dede:channelartlist typeid='top'}<li{dede:field.currentstyle/}><a href="{dede:field name='typeurl'/}">{dede:field name='typename'/}</a></li>{/dede:channelartlist}
This way you can use currentstyle in the dede:channelartlist tag that calls all columns.
Among them: 3. The class="on" inside is the style added to the current column. You can modify on to what you want.
The above is the detailed content of The method of restricting bytes in the column highlighting special style in Dreamweaver CMS. For more information, please follow other related articles on the PHP Chinese website!