织梦DedeCms调用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 `dede_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的子栏目。

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。

给TA打赏
共{{data.count}}人
人已打赏
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索