全国400电话网上服务平台
强大号码库资源任选,方便,快捷,快速开通。
咨询热线:400-1100-266
强大号码库资源任选,方便,快捷,快速开通。
咨询热线:400-1100-266
织梦channelartlist调用排除指定typeid栏目数据的方法
POST TIME:2021-05-23 01:16
|
在制作织梦dedecms模板的时候,在使用 dede:channelartlist 自动调用栏目内容时,经常会遇到某些栏目不需要调用,比如“关于我们”、“联系地址”等无持续更新的栏目。要想在 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"); 在其前面添加 //否定指定ID if($notypeid!=0) { $tpsql = $tpsql."and not(id in($notypeid)) "; } 模板调用: {dede:channelartlist typeid ='7' notypeid='8'} 其中notypeid=’8′ 中的 8 为 7 的子栏目即生效。 当然notypeid和typeid也可以分开各自使用. |
Copyright © 2003-2016
时间:9:00-21:00 (节假日不休)
版权所有:巨人网络(扬州)科技有限公司
总部地址:江苏省信息产业基地11号楼四层
《增值电信业务经营许可证》 苏B2-20120278

时间:9:00-21:00 (节假日不休)
版权所有:巨人网络(扬州)科技有限公司
总部地址:江苏省信息产业基地11号楼四层
《增值电信业务经营许可证》 苏B2-20120278

