織夢模板channelartlist標(biāo)簽支持currentstyle的修,DEDE技
導(dǎo)讀:DEDE技術(shù)DEDE技術(shù)織夢dedecms模板網(wǎng)站里面默認(rèn)只有channel標(biāo)簽支持currentstyle屬性,但是今天在做一個(gè)資訊網(wǎng)站的時(shí)候channelartlist也需要使用cdede后臺模板dede模板免費(fèi)。
織夢dedecms模板網(wǎng)站里面默認(rèn)只有channel標(biāo)簽支持currentstyle屬性,但是今天在做一個(gè)資訊網(wǎng)站的時(shí)候channelartlist也需要使用currentstyle屬性,怎么辦呢? 找了很久,終于有了完美的解決辦法: 打開include\taglib\channelartlist.lib.php 找到 $pv->Fields['typeurl'] = GetOneTypeUrlA($typeids[$i]); 在此行代碼下方增加以下代碼: 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'] = ''; } 網(wǎng)上找到的一般沒有加 $typeids夢織模板[$i]['id'] ==$refObj->TypeLink->TypeInfos['topid'] 添加這個(gè)后才能對二級欄目也起作用 調(diào)用方法:
{dede:channelartlist typeid='2,3,4,5,6,7,8,9,10,1dede網(wǎng)站模板1,12,13織夢文章模板,14,15,16' currentstyle='current'} < li class='{dede:field.currentstyle/}'> <a href="{dede:field name='typeurl'/}" title="{dede:field name='typename'/}">{dede:field name='typename'/}</a> </li> 。。。 {/dede:channelartlist} 如果是當(dāng)前欄目則 li的class屬性顯示current,否則顯示class='' ,也可以修改currentstyle='這里改為你需要的類名'。 這樣channelartlist標(biāo)簽也可以使用currentstyle屬性了。
相關(guān)dede后臺模板dede模板免費(fèi)。聲明: 本文由我的SEOUC技術(shù)文章主頁發(fā)布于:2023-07-21 ,文章織夢模板channelartlist標(biāo)簽支持currentstyle的修,DEDE技主要講述標(biāo)簽,模板,織夢網(wǎng)站建設(shè)源碼以及服務(wù)器配置搭建相關(guān)技術(shù)文章。轉(zhuǎn)載請保留鏈接: http://www.bifwcx.com/article/web_32593.html
為你推薦與織夢模板channelartlist標(biāo)簽支持currentstyle的修,DEDE技相關(guān)的文章
-
dedecms首頁中文章列表無刷新頂、踩的實(shí)現(xiàn)
(120)人喜歡 2023-07-21 -
織夢網(wǎng)站地圖Sitemap+百度Ping推送功能實(shí)現(xiàn)
(160)人喜歡 2023-07-21 -
DeDecms后臺設(shè)置及網(wǎng)站地圖seo優(yōu)化,織夢技
(50)人喜歡 2023-07-21 -
DedeCMS模板制作自定義表單時(shí)添加驗(yàn)證碼的
(166)人喜歡 2023-07-21 -
織夢標(biāo)簽:sonchannel 子欄目調(diào)用,織夢教程
(103)人喜歡 2023-07-21 -
在織夢cms中使用繁體轉(zhuǎn)簡體的函數(shù)BIG5To
(186)人喜歡 2023-07-21