Home > CMS Tutorial > DEDECMS > The method of restricting bytes in the column highlighting special style in Dreamweaver CMS

The method of restricting bytes in the column highlighting special style in Dreamweaver CMS

(*-*)浩
Release: 2019-11-28 11:56:15
Original
2597 people have browsed it

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 method of restricting bytes in the column highlighting special style in Dreamweaver CMS

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

4. Calling method:

{dede:channelartlist typeid=&#39;top&#39;}<li{dede:field.currentstyle/}><a href="{dede:field name=&#39;typeurl&#39;/}">{dede:field name=&#39;typename&#39;/}</a></li>{/dede:channelartlist}
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template