"景先生毕设|www.jxszl.com

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

2022-10-29 16:26编辑: www.jxszl.com景先生毕设
摘要:dede:channelartlist嵌套dede:channel,如果想要channel也能使用currentstyle,那需要修改II步就能轻松实现II级高亮.
dede:channelartlist栏目高亮实现教程
打开/include/taglib/channelart

 更多精彩就在: 51免费论文网|www.jxszl.com 
list.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:channelartlistrow=VIItypeid=topcurrentstyle=current}{dede:field.typename/}
      {dede:channeltype=sonnoself=yesrow=I.0currentstyle="~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]


原文链接:http://www.jxszl.com/biancheng/dedecms/74830.html