雷火电竞-中国电竞赛事及体育赛事平台

歡迎來到入門教程網(wǎng)!

dedecms

當(dāng)前位置:主頁 > CMS教程 > dedecms >

織夢channelartlist高亮并且讓嵌套標(biāo)簽里的channel也支持currentstyle高亮

來源:本站原創(chuàng)|時(shí)間:2021-08-05|欄目:dedecms|點(diǎn)擊:

摘要:dede:channelartlist嵌套dede:channel,如果想要channel也能使用currentstyle,那需要修改2步就能輕松實(shí)現(xiàn)二級(jí)高亮。
dede:channelartlist欄目高亮實(shí)現(xiàn)教程
打開 /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['reid'] || $typeids[$i]['id'] == $refObj->TypeLink->TypeInfos['topid'] || $typeids[$i]['id'] == GetTopid($refObj->TypeLink->TypeInfos['id']) ) { $pv->Fields['currentstyle'] = $currentstyle ? $currentstyle : 'current'; } else { $pv->Fields['currentstyle'] = ''; }
然后 dede:channelartlist 標(biāo)簽里是高亮標(biāo)簽調(diào)用是
{dede:field.currentstyle/}
例如下面的寫法
嵌套標(biāo)簽
<div class="nav"> <ul> {dede:channelartlist row=7 typeid=top currentstyle=current} <li class="{dede:field.currentstyle/}"> <a href="{dede:field.typeurl/}">{dede:field.typename/}</a> <ul> {dede:channel type='son' noself='yes' row='10' currentstyle="<li class='hover'><a href='~typelink~'>~typename~</a></li>"} <li><a href="[field:typeurl/]">[field:typename/]</a></li> {/dede:channel} </ul> </li> {/dede:channelartlist} </ul> </div>
channelartlist嵌套channel標(biāo)簽也高亮實(shí)現(xiàn)教程
打開 /include/taglib/channel.lib.php 找到
global $dsql;
改成
global $dsql,$_sys_globals;
繼續(xù)找到
$row['id']==$typeid
改成
$row['id']==$typeid || $row['id']==$_sys_globals['typeid']
 

上一篇:織夢網(wǎng)站后臺(tái)站點(diǎn)和標(biāo)題描述的設(shè)置

欄    目:dedecms

下一篇:dede織夢后臺(tái)登錄成功后又返回的解決方法

本文標(biāo)題:織夢channelartlist高亮并且讓嵌套標(biāo)簽里的channel也支持currentstyle高亮

本文地址:http://www.jygsgssxh.com/a1/dedecms/15247.html

更多dedecms

您可能感興趣的文章

閱讀排行

本欄相關(guān)

隨機(jī)閱讀

網(wǎng)頁制作CMS教程網(wǎng)絡(luò)編程軟件編程腳本語言數(shù)據(jù)庫服務(wù)器

如果侵犯了您的權(quán)利,請(qǐng)與我們聯(lián)系,我們將在24小時(shí)內(nèi)進(jìn)行處理、任何非本站因素導(dǎo)致的法律后果,本站均不負(fù)任何責(zé)任。

聯(lián)系QQ:835971066 | 郵箱:835971066#qq.com(#換成@)

Copyright © 2002-2020 腳本教程網(wǎng) 版權(quán)所有