第一:arclist的typeid调用方法
typeid=’’栏目ID,在列表模板和档案模板中一般不需要指定,在封面模板中允许用","分开表示多个栏目。
第二:织梦arclist标签增加notypeid属性的方法
1、主要修改文件是/include/taglib/下的arclist.lib.php文件
首先搜索:
return lib_arclistDone
在函数末尾加上:,$ctag->GetAtt(’notypeid’) ,原来的代码变成如下的样子:
return lib_arclistDone
(
$refObj, $ctag, $typeid, $ctag->GetAtt(’row’), $ctag->GetAtt(’col’), $titlelen, $infolen,
$ctag->GetAtt(’imgwidth’), $ctag->GetAtt(’imgheight’), $listtype, $orderby,
$ctag->GetAtt(’keyword’), $innertext, $envs[’aid’], $ctag->GetAtt(’idlist’), $channelid,
$ctag->GetAtt(’limit’), $flag,$ctag->GetAtt(’orderway’), $ctag->GetAtt(’subday’), $ctag->GetAtt(’noflag’),
$tagid,$pagesize,$isweight,
$ctag->GetAtt(’notypeid’)
);
然后,搜索function lib_arclistDone,同样在这个函数的后面加上一句代码:,$notypeid=0,修改后的函数变成下面的样子:
function lib_arclistDone(&$refObj, &$ctag, $typeid=0, $row=10, $col=1, $titlelen=30, $infolen=160, $imgwidth=120, $imgheight=90, $listtype=’all’, $orderby=’default’, $keyword=’’, $innertext=’’, $arcid=0, $idlist=’’, $channelid=0, $limit=’’, $att=’’, $order=’desc’, $subday=0, $noflag=’’,$tagid=’’, $pagesize=0, $isweight=’N’,$notypeid=0)
最后,找到再找到这一句:$orwheres[] = ’ arc.arcrank > -1 ’; ,在这个代码的前面加入如下代码:
if(!empty($notypeid))
{
$orwheres[] = " and arc.typeid NOT IN (".GetSonIds($notypeid).")";
}
完成,使用下面的标签就可以排除指定栏目的文章调用了。
第三:织梦arclist标签调用notypeid属性过滤指定栏目的方法
实例调用如下:
<ul>
{dede:arclist row=’10’ titlelen=’100’ orderby=’pubdate’ notypeid=’3,5,6’}
</ul>
意思是按更新时间,调用除了栏目id是3,5,6的其余栏目中的6条数据。