文章来源:http://www.imtr.cn/html/n33.html
DedeCMS在文章内容页中调用当前栏目的名称是可以用{dede:field.typename/}来实现的
可是想要内容页调取当前所属栏目的链接用{dede:field.typeurl/}没有效果
在这里小编整理了两种在内容页调取栏目url的方法提供给大家
第一种方法:
{dede:type} <a href="[field:typelink/]">[field:typename/]</a> {/dede:type}
其中[field:typelink/]就是栏目的链接,[field:typename/]是栏目的名称。
第二种方法:
打开/include/arc.archives.class.php文件,找到约241行的如下代码:
//设置全局环境变量 $this->Fields['typename'] = $this->TypeLink->TypeInfos['typename'];
在下面一行加入一句
$this->Fields['typeurl'] = $this->TypeLink->GetOneTypeUrl($this->TypeLink->TypeInfos);
最终结果就像这样:
//设置全局环境变量 $this->Fields['typename'] = $this->TypeLink->TypeInfos['typename']; $this->Fields['typeurl'] = $this->TypeLink->GetOneTypeUrl($this->TypeLink->TypeInfos);
然后再使用{dede:field.typeurl/}来调取栏目的URL
原文地址:http://www.imtr.cn/html/n33.html