一弯拱桥对映着一弯晓月,桥下流水波光粼粼,昙花一般的月,在我眼中异香腾风,秀色媚景。夜的静谧是风景,昼的明媚是风景。江花胜火红,寒山伤心碧,空伫玉阶白,西风残照黄。处处皆风景,处处皆绝妙风景。
dede:channelartlist标签当前栏目高亮实现好代码教程
打开 /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 标签里是高亮标签调用是
{dede:field.currentstyle/}
例如下面的写法
嵌套dede标签
<div class="nav"> <ul> {dede:channelartlist row=7 typeid=top currentstyle=current} <li class="{dede:field.currentstyle/}"> <a rel="nofollow noopener noreferrer" href="{dede:field.typeurl/}">{dede:field.typename/}</a> <ul> {dede:channel type='son' noself='yes' row='10' currentstyle="<li class='hover'><a rel="nofollow noopener noreferrer" href='~typelink~'>~typename~</a></li>"} <li><a rel="nofollow noopener noreferrer" href="[field:typeurl/]">[field:typename/]</a></li> {/dede:channel} </ul> </li> {/dede:channelartlist} </ul> </div>
织梦好代码教程
打开 /include/taglib/channel.lib.php 找到
global $dsql;
改成
global $dsql,$_sys_globals;
继续找到
$row['id']==$typeid
改成
$row['id']==$typeid || $row['id']==$_sys_globals['typeid']
以上就是dede织梦channelartlist高亮并且让嵌套标签里的channel。明天的但愿,让我们忘了今天的痛苦。更多关于dede织梦channelartlist高亮并且让嵌套标签里的channel请关注haodaima.com其它相关文章!