Home > CMS Tutorial > DEDECMS > How does Dreamweaver dede make the channelartlist tag support the currentstyle attribute?

How does Dreamweaver dede make the channelartlist tag support the currentstyle attribute?

藏色散人
Release: 2020-01-09 09:41:21
Original
2265 people have browsed it

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]);
Copy after login

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

Calling method:

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

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!

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