Pursuing a dream two columns increases highlight style

Pursuing a dream secondary menu is clicked column highlighted call the method:

The first step: Since the default weaving dreams dede: channelartlist tag is not supported currentstyle property, so at first then add modifications channelartlist.lib.php

1: Open include \ taglib \ channelartlist.lib.php, found $ pv-> Fields [ 'typeurl'] = GetOneTypeUrlA ($ typeids [$ i]);

2: $ pv-> Fields [ 'typeurl'] = GetOneTypeUrlA ($ typeids [$ i]); add the following code at

1  $pv->Fields['typeurl'] = GetOneTypeUrlA($typeids[$i]);
2                       if($typeids[$i]['id'] == $refObj->TypeLink->TypeInfos['id'] || $typeids[$i]['id'] == $refObj->TypeLink->TypeInfos['topid'] ){  
3                          $pv->Fields['currentstyle'] = $currentstyle ? $currentstyle : 'navOn';  
4                           }  
5                         else{  
6                         $pv->Fields['currentstyle'] = '';  
7                          }  

Step two: the front desk to call:

 1 {dede:channelartlist   typeid='47,58,59,70,71,60'  currentstyle='nav_active' }
 2             <li class="{dede:field.currentstyle/}">
 3                 <a href="{dede:field name='typeurl'/}">
 4                     <h1>{dede:field name='typename'/}</h1>
 5                     <!-- <h2>ABOUT</h2> -->
 6                     <dl>
 7                     {dede:channel type='son' noself='yes' }
 8                             <a href="[field:typelink/]">
 9                                 <dd>
10                                     <span>
11                                         <b>-</b>
12                                     </span>[field:typename/]<span>
13                                         <b>-</b>
14                                     </span>
15                                 </dd>
16                             </a>
17                     {/dede:channel}
18                     </dl>
19                 </a>
20             </>
21 {/dede:channelartlist} 
currentstyle='nav_active'
class="{dede:field.currentstyle/}"

 

Guess you like

Origin www.cnblogs.com/php-qiuwei/p/11410208.html