dedecms调用当前文档所在栏目链接和栏目名称

在内容页模板时,可直接用织梦dedecms  {dede:field.typename/} 来表示当前文档的栏目名称,但却无法使用 {dede:field.typeurl/} 形式来调用栏目链接,该方法同时支持DedeV5.5/5.6/5.7,不区分程序编码。 解决办法 第一步:打开 /include/arc.archives.class.php 文件,找到约241行如下代码 //设置全局环境变量 $this->Fields['typename'] = $this->TypeLink->TypeInfos['typename']; 在其下一行加入如下代码: //设置全局环境变量 $this->Fields['typelink'] = $this->TypeLink->GetOneTypeLink($this->TypeLink->TypeInfos); $this->Fields['typeurl'] = $this->TypeLink->GetOneTypeUrl($this->TypeLink->TypeInfos); 第二步:在你的内容页模板适当位置加入调用代码 {dede:field.typelink/} 带链接的栏目名称,显示:<a href="栏目链接地址">栏目名称</a> {dede:field.typeurl/} 仅栏目链接,显示: /news 。