栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > PHP > php开源框架 > dedecms

织梦channelartlist高亮并且让嵌套标签里的channel也支持currentstyle高亮

dedecms 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

织梦channelartlist高亮并且让嵌套标签里的channel也支持currentstyle高亮

摘要:dede:channelartlist嵌套dede:channel,如果想要channel也能使用currentstyle,那需要修改2步就能轻松实现二级高亮。

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:channelartlist row=7 typeid=top currentstyle=current}
  • {dede:field.typename/}
      {dede:channel type='son' noself='yes' row='10' currentstyle="
    • ~typename~
    • "}
    • [field:typename/]
    • {/dede:channel}
  • {/dede:channelartlist}

channelartlist嵌套channel标签也高亮实现教程

打开 /include/taglib/channel.lib.php 找到

global $dsql;

改成

global $dsql,$_sys_globals;

继续找到

$row['id']==$typeid

改成

$row['id']==$typeid || $row['id']==$_sys_globals['typeid']

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/4125.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号