织梦dede:channelartlist调用排除指定typeid栏目
织梦dede:channelartlist调用排除指定typeid栏目,怎样让织梦DEDECMS的dede:channelartlist语句解除指定typeid,dedecmschannelartlist不调用指定分类排除指定typeid的方,织梦dede:channelartlist调用排除指定typeid栏目数据的方,下面小编来给大家介绍一下,一起来了解一下吧!
织梦DedeCms channelartlist调用排除指定typeid栏目数据,找到 \include\taglib\channelartlist.lib.php,查找$attlist
将
$attlist = 'typeid|0,row|20,cacheid|'; |
修改为:
$attlist = 'typeid|0,row|20,cacheid|,notypeid|0'; //此处添加了一个所要排除typeid的参数---notypeid |
查找:
$dsql->SetQuery("Select id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath from `zmb_arctype` where $tpsql order by sortrank asc limit $totalnum");
|
在其前面添加(注意是在前面添加):
//否定指定ID
if($notypeid!=0) {
$tpsql = $tpsql."and not(id in($notypeid)) ";
}
|
模板调用:
{dede:channelartlist typeid ='114' notypeid='123,124,122,127'}
|
其中notypeid='123,124,122,127'中的123,124,122,127为114的子栏目。
以上就是织梦dede:channelartlist调用排除指定typeid栏目的介绍,希望大家喜欢!
更多教程关注FF推源码网。