dede使用channelartlist reid属性调用同级栏目
原网址:http://jingyan.baidu.com/article/066074d6725955c3c21cb006.html
找到\include\taglib\channelartlist.lib.php
文件查找:
$attlist = 'typeid|0,row|20,cacheid|';
修改为:
$attlist = 'typeid|0,row|20,cacheid|,type|'; //这边加个 type 实现 在子栏目下调用 同级子栏目的信息
然后查找:
if($typeid==0 || $typeid=='top') {
$tpsql = " reid=0 AND ispart<>2 AND ishidden<>1 AND channeltype>0 ";
}
修改为:
if($type=='reid') //调用上级目录下的子栏目内容
{
$reid = $refObj->TypeLink->TypeInfos['reid'];
$tpsql = " reid='$reid' AND ispart<>2 AND ishidden<>1 ";
}
else if($typeid==0 || $typeid=='top') {
$tpsql = " reid=0 AND ispart<>2 AND ishidden<>1 AND channeltype>0 ";
}
保存上面文件。然后在列表页或者内容页使用{dede:channelartlist type='reid' row='5'}底层循环代码{/dede:channelartlist} 就可以方便调用了。
浙公网安备 33010602011771号