dedecms内容页调用栏目链接和栏目名称的办法

第一步:打开 /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
 
以上两种方式可任选一种即可。

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/12.html