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

  • 相关阅读:
    R
    R 包的安装,使用,更新
    R 安装 简单实用
    R 介绍
    mongo:用户管理
    MySQL 书籍
    mongo: 索引
    blog
    游标处理
    如何在ASP.NET的web.config配置文件中添加MIME类型
  • 原文地址:https://www.cnblogs.com/init-007/p/11337862.html
Copyright © 2011-2022 走看看