精品国产免费观看久久久_久久天天躁狠狠躁夜夜爽_无码人妻少妇久久中文字幕_狠狠做深爱婷婷久久综合一区

網絡建站知識

精準傳達 ? 價值共享

洞悉互聯網前沿資訊,探尋網站營銷規律

查看其它板塊

dede讓channelartlist標簽支持currentstyle屬性 完美解決

作者:Smileby陌少羽 | 2018-06-23 14:47 |點擊:

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


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


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


 
 
  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.          }  


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


 
 
  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}  

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

如沒特殊注明,文章均為狐靈科技原創,轉載請注明?? " dede讓channelartlist標簽支持currentstyle屬性 完美解決
多一份免費策劃方案,總有益處。

請直接添加技術總監微信聯系咨詢

網站設計 品牌營銷

多一份參考,總有益處

聯系狐靈科技,免費獲得專屬《策劃方案》及報價

咨詢相關問題或預約面談,可以通過以下方式與我們聯系

業務熱線:15082661954 / 大客戶專線:15523356218