dedecms内容页模板时,可直接用 {dede:field.typename/} 来表示当前文档的栏目名称。
但却无法使用 {dede:field.typeurl/} 形式来调用栏目链接。
修改方法
打开/include/arc.archives.class.php文件
找到
//设置全局环境变量

$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
以上两种方式可任选一种即可。