DEDECMS织梦内容页调用seotitle标题的写法
2019-08-28集模板136次
DEDECMS织梦内容页调用seotitle标题的写法,首先方法一,直接用织梦的sql实现:
首先方法一,直接用织梦的sql实现:
1 <title>
2 {dede:field name='typeid' runphp='yes'}
3 $id=@me;
4 global $dsql;
5 $sql="select seotitle from dede_arctype where id=$id";
6 $row=$dsql->getOne($sql);
7 @me=$row["seotitle"];
8 {/dede:field}
9 </title>

第二种方法,需要修改下include/arc.archives.class.php 这个文件,找到:
1 $this->Fields['typename'] = $this->TypeLink->TypeInfos['typename'];
在这段的下面添加:
1 $this->Fields['seotitle'] = $this->TypeLink->TypeInfos['seotitle'];
调用方法,直接在内容页中写:{dede:field.seotitle/}
不想修改文件直接用第一种方法, 喜欢动手的可以采用第二种方法,个人推荐采用第二种方法。