用织梦做网站时候,调用相关文章标签likearticle只能匹配相同关键词的文章,整站调用的话每个文档都还要自己手动加入关键字,很多一部分也就是想调用同级栏目里的文章,织梦模版网解决了这个织梦建站难题。
一、首先找到:
//处理标记属性、innertext
$attlist = 'typeid|0,row|20,cacheid|';
替换为:
//处理标记属性、innertext
$attlist = 'typeid|0,row|20,cacheid|,type|';
二、找到: if($typeid==0 || $typeid=='top')
{ $tpsql = " reid=0 AND ispart<>2 AND ishidden<>1 AND channeltype>0 ";
}
替换为:
if($type=='self') //调用同级栏目文章内容
{
$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 row='1' type ='self' }
{dede:arclist titlelen='600' orderby='pubdate' row='4'}
[field:title/]
{/dede:arclist}
{/dede:channelartlist}