Skip to main content
 Web开发网 » 站长学院 » 织梦教程

DEDECMS织梦内容页调用seotitle标题的写法

2020年09月12日7270百度已收录

首先方法一,直接用织梦的sql实现:

 

<span style="font-size:14px;">1

<title>

{dede:field name='typeid' runphp='yes'}

$id=@me;

global $dsql;

$sql="select seotitle from dede_arctype where id=$id";

$row=$dsql->getOne($sql);

@me=$row["seotitle"];

{/dede:field}

</title>

</span>

 

第二种方法,需要修改下include/arc.archives.class.php 这个文件,找到:

 

<span style="font-size:14px;">1

$this->Fields['typename'] = $this->TypeLink->TypeInfos['typename'];

</span>

 

<span style="font-size:14px;">1

$this->Fields['typename'] = $this->TypeLink->TypeInfos['typename'];

</span>

 

在这段的下面添加:

 

<span style="font-size:14px;">1

$this->Fields['seotitle'] = $this->TypeLink->TypeInfos['seotitle'];

</span>

 

调用方法,直接在内容页中写:{dede:field.seotitle/}

 

不想修改文件直接用第一种方法, 喜欢动手的可以采用第二种方法,个人推荐采用第二种方法。


 

评论列表暂无评论
发表评论
微信