在处理企业站的时候,经常发现要调用二三级栏目栏目,且需要高亮显示,具体实现方法如下。
1、打开 \include\taglib\channelartlist.lib.PHP 找到
PHP">$tpsql = " reid='$typeid' AND ispart<>2 AND ishidden<>1 ";
改成
TypeLink->TypeInfos['id']) ? GetTopid($refObj->TypeLink->TypeInfos['id']) : 0 ); $tpsql = " reid='$typeid' AND ishidden<>1 "; } else { $tpsql = " reid='$typeid' AND ispart<>2 AND ishidden<>1 "; }
2、打开 \include\taglib\channel.lib.PHP 找到
PHP">if($type=='son' && $reid!=0 && $totalRow==0
改成
PHP">if($type=='son' && $reid!=0 && $totalRow==0 && $noself=='')
PHP">
-
{dede:PHP}
$GLOBALS['thisid'] = intval($refObj->Fields['typeid']);
$GLOBALS['reid'] = intval($refObj->Fields['reid']);
$GLOBALS['topid'] = intval($refObj->Fields['topid']);
{/dede:PHP}
{dede:channelartlist type=son}
- {dede:field.typename/}
- [field:typename/] {/dede:channel}
-
{dede:channel type=son noself=yes}
至此,全部完成。
原文链接:https://www.f2er.com/dedecms/403748.html