在制作织梦模板的时候,要想在 dede:channelartlist 调用时排出某些栏目,这需要修改dede源码,让 dede:channelartlist 排除指定typeid。打开 \include\taglib\channelartlist.lib.php 文件找到$attlist = 'typeid|0,row|20,cacheid|';修改为:$attlist = 'typeid|0,row|20,cacheid|,notypeid|0'; // 此处添加了一个所要排除typeid的参数—notypeid找到$dsql->SetQuery("Selectid,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath from `dede_arctype` where $tpsql order by sortrank asc limit $totalnum");在其前面添加//否定指定IDif($notypeid!=0) { $tpsql = $tpsql."and not(id in($notypeid)) ";}模板调用:{dede:channelartlist typeid ='7' notypeid='8'}其中notypeid=’8′ 中的 8 为 7 的子栏目即生效。当然notypeid和typeid也可以分开各自使用.
来源:https://www.jianshu.com/p/b40205f50cd1
转载于:https://www.cnblogs.com/init-007/p/11337862.html