好湿?好紧?好多水好爽自慰,久久久噜久噜久久综合,成人做爰A片免费看黄冈,机机对机机30分钟无遮挡

主頁 > 網(wǎng)站建設(shè) > 建站知識 > dede讓channelartlist標(biāo)簽支持currentstyle屬性 完美解決

dede讓channelartlist標(biāo)簽支持currentstyle屬性 完美解決

POST TIME:2017-10-29 22:16

打開include\taglib\channelartlist.lib.php
找到

[php] view plaincopyprint?
  1. $pv->Fields['typeurl'] = GetOneTypeUrlA($typeids[$i]);  

在此行代碼下方增加以下代碼:

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

網(wǎng)上找到的一般沒有加$typeids[$i]['id'] ==$refObj->TypeLink->TypeInfos['topid']
添加這個后才能對二級欄目也起作用
調(diào)用方法:

[php] view plaincopyprint?
  1. {dede:channelartlist typeid='2' currentstyle='current'}  
  2.  <li class='{dede:field.currentstyle/}'><a href='{dede:field name='typeurl'/}'>{dede:field name='typename'/}</a></li>  
  3.  。。。  
  4.  {/dede:channelartlist}  
  5.    

如果是當(dāng)前欄目則 li的class屬性顯示current,否則顯示class='' ,也可以修改currentstyle='這里改為你需要的類名'。



收縮
  • 微信客服
  • 微信二維碼
  • 電話咨詢

  • 400-1100-266