Channel标签一般用于循环调用栏目,在用DeDe系统进行网站建设时,经常会利用该标签调用栏目信息,但是,该标签却无法调用栏目description或content标签,我们要做的只是将Description这个属性开启即可。
到你的程序目录 include\taglib 找到 channel.lib.php 修改一下文件,查找sitepath, 在后面加上description,content 一共修改4处,红色部分是添加的,修改后代码:
if($type=='top') { $sql = "SELECT id,typename,typedir,typebigpic,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath,description,content 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,typebigpic,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath,description,content 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,typebigpic,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath,description,content FROM `dede_arctype` WHERE reid='$reid' And ishidden<>1 order by sortrank asc limit 0, $line "; } //And id<>'$typeid' $needRel = false; $dtp2 = new DedeTagParse(); $dtp2->SetNameSpace('field','[',']'); $dtp2->LoadSource($innertext); //检查是否有子栏目,并返回rel提示(用于二级菜单) if(preg_match('#:rel#', $innertext)) $needRel = true; if(empty($sql)) return ''; $dsql->SetQuery($sql); $dsql->Execute(); $totalRow = $dsql->GetTotalRow(); //如果用子栏目模式,当没有子栏目时显示同级栏目 if($type=='son' && $reid!=0 && $totalRow==0) { $sql = "SELECT id,typename,typedir,typebigpic,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath,description,content FROM `dede_arctype` WHERE reid='$reid' And ishidden<>1 order by sortrank asc limit 0, $line "; $dsql->SetQuery($sql); $dsql->Execute(); }