婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 網站建設 > 建站知識 > dede讓channelartlist標簽支持currentstyle屬性 完美解決

dede讓channelartlist標簽支持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.    

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

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

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



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

  • 400-1100-266
主站蜘蛛池模板: 安乡县| 贵德县| 苏尼特左旗| 乐业县| 衡东县| 高州市| 永清县| 新郑市| 隆化县| 彝良县| 紫金县| 延吉市| 德清县| 武冈市| 西充县| 定日县| 灵石县| 藁城市| 靖边县| 文昌市| 衡阳县| 嵊泗县| 许昌市| 萨迦县| 上蔡县| 赤峰市| 浦县| 莒南县| 平乡县| 工布江达县| 唐河县| 石楼县| 冀州市| 漳州市| 青神县| 罗源县| 尚志市| 皋兰县| 上林县| 大竹县| 阳高县|