欢迎来到素材无忧网,按 + 收藏我们
登录 注册 退出 找回密码

织梦中{dede:channel}无法调用隐藏栏目解决方法

时间: 2018-12-07 23:49 阅读: 作者:素材无忧网

dede如何控制隐藏栏目的显示与调用

许多时候有些栏目想在某些页面隐藏,在另外一些页面显示,怎么办?

貌似,织梦的channel标签不能获取隐藏的栏目,于是我自己动手修改channel标签

首先找到include/taglib/channel.lib.php

1.

$attlist = "typeid|0,reid|0,row|100,col|1,type|son,currentstyle|,cacheid|";

修改为:

$attlist = "typeid|0,reid|0,row|100,col|1,type|son,currentstyle|,cacheid|,showhide|no";

2.

在这两句下 

    $innertext = $ctag->GetInnerText();

    $line = empty($row) ? 100 : $row;

增加:

    $showhideArr = array(

        'yes' => 0,

        'no' => 1,

        'both'=> -1,

    );

    $hideflag = $showhideArr[$showhide];

 

3.

  if($type=='top')

    {

        $sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath

          From `dede_arctype` WHERE reid=0 And ishidden<>1 order by sortrank asc limit 0, $line ";

    }

    else if($type=='son')

    {

        if($typeid==0) return '';

        $sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath

          From `dede_arctype` WHERE reid='$typeid' And ishidden<>1 order by sortrank asc limit 0, $line ";

    }

    else if($type=='self')

    {

        if($reid==0) return '';

        $sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath

            FROM `dede_arctype` WHERE reid='$reid' And ishidden<>1 order by sortrank asc limit 0, $line ";

    }

 

修改为:

   if($type=='top')

    {

        $sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath

          From `dede_arctype` WHERE reid=0 And ishidden<>$hideflag order by sortrank asc limit 0, $line ";

    }

    else if($type=='son')

    {

        if($typeid==0) return '';

        $sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath

          From `dede_arctype` WHERE reid='$typeid' And ishidden<>$hideflag order by sortrank asc limit 0, $line ";

    }

    else if($type=='self')

    {

        if($reid==0) return '';

        $sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname


版权声明: 本站资源均来自互联网或会员发布,如果侵犯了您的权益请与我们联系,我们将在24小时内删除!谢谢!

转载请注明: 织梦中{dede:channel}无法调用隐藏栏目解决方法

标签:  
相关文章
模板推荐