VIP福利
主页 > 建站问题 > DedeCMS织梦head.htm里调用栏目描述

DedeCMS织梦head.htm里调用栏目描述

问题: DedeCMS织梦系统 {dede:channel type='top'} [field:description/] {/dede:channel} 为什么没有循环出每个栏目的描述 回答: {dede:channel type='top'} [field:description/] {/dede:channel} channel 这个标签没有description属性你需要自己把这个 […]



问题:
DedeCMS织梦系统
{dede:channel type='top'}
[field:description/]
{/dede:channel}
为什么没有循环出每个栏目的描述

回答:
{dede:channel type='top'}
[field:description/]
{/dede:channel}
channel 这个标签没有description属性你需要自己把这个属性开启。
到你的程序目录include\taglib\ 找到 channel.lib.php 修改一下文件

如果你想查找所有top最顶层的栏目内容的话修改

if($type=='top')
    {
        $sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath,description
          From `58pic_arctype` WHERE reid=0 And ishidden<>1 order by sortrank asc limit 0, $line ";
    }

数据库后面添加一个字段description

$row['description']=$row['description'];//这个就是新添加的内容

$row['typelink'] = $row['typeurl'] = GetOneTypeUrlA($row);
                    if(is_array($dtp2->CTags))
                    {
                        foreach($dtp2->CTags as $tagid=>$ctag)
                        {
                            if(isset($row[$ctag->GetName()])) $dtp2->Assign($tagid,$row[$ctag->GetName()]);
                        }
                    }
                    $likeType .= $dtp2->GetResult();
找到这段在前面添加一条
$row['description']=$row['description'];

然后在你的标签就可以调用了。就这么简单
说点什么吧
  • 全部评论(0
    还没有评论,快来抢沙发吧!