muban大师 发表于 2020-6-3 09:29:06

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

首先方法一,直接用织梦的sql实现:
       
        1
       
        {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}
       
       
       
        第二种方法,需要修改下include/arc.archives.class.php 这个文件,找到:
       
        1
        $this->Fields['typename', = $this->TypeLink->TypeInfos['typename',;
       
       
        1
        $this->Fields['typename', = $this->TypeLink->TypeInfos['typename',;
       
       
        在这段的下面添加:
       
        1
        $this->Fields['seotitle', = $this->TypeLink->TypeInfos['seotitle',;
       
       
        调用方法,直接在内容页中写:{dede:field.seotitle/}
       
        不想修改文件直接用第一种方法, 喜欢动手的可以采用第二种方法,个人推荐采用第二种方法。
页: [1]
查看完整版本: DEDECMS织梦内容页调用seotitle标题的写法