dede织梦内容页调用栏目链接和栏目名称


在织梦内容页,可直接用 {dede:field.typename/} 来表示当前文档的栏目名称,但却无法使用 {dede:field.typeurl/} 形式来调用栏目链接。

解决办法

打开 /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/} 带链接的栏目名称。

{dede:field.typeurl/} 仅栏目链接。