日志样式

织梦内容页调用栏目链接和栏目名称的方法



在织梦内容页,可直接用 {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/} 仅栏目链接,如:/news以上两种方式可任选一种即可。

 

要调用上级栏目名称及链接请移步《织梦DedeCMS上级栏目名称及链接的2种调用方法



上一篇:织梦专题页去.html后缀的方法 下一篇:最新织梦DedeCMS V5.7 SP2模板安装图文教程