zoukankan      html  css  js  c++  java
  • 织梦dede:channelartlist调用排除指定typeid栏目

    在制作织梦模板的时候,要想在 dede:channelartlist 调用时排出某些栏目,这需要修改dede源码,让 dede:channelartlist 排除指定typeid。
    打开 include aglibchannelartlist.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也可以分开各自使用.

    来源:https://www.jianshu.com/p/b40205f50cd1

  • 相关阅读:
    js数组
    关于编程,程序员的一些语录
    css心得
    js函数
    一些电脑基础知识
    gnome3安装
    C学习小记
    ubuntu重装系统后
    elinks文字浏览器
    快捷方式
  • 原文地址:https://www.cnblogs.com/init-007/p/11337862.html
Copyright © 2011-2022 走看看