1、先找到目录include中的arc.archives.class.php搜索:
//设置全局环境变量
$this->Fields['typename'] = $this->TypeLink->TypeInfos['typename'];
@SetSysEnv($this->Fields['typeid'],$this->Fields['typename'],$this->Fields['id'],$this->Fields['title'],'archives');
2、在这段代码下下面添加:
//替换图片Alt为文档标题
$this->Fields['body'] = str_ireplace(array('alt=""','alt=/'/''),'',$this->Fields['body']);
$this->Fields['body'] = preg_replace("@ [/s]{0,}alt[/s]{0,}=[/"'/s]{0,}[/s/S]{0,}[/"'/s] @isU"," ",$this->Fields['body']);
$this->Fields['body'] = str_ireplace("<img " ,"<img alt=/"".$this->Fields['title']."/" ",$this->Fields['body']);
最后生成一下文档HTML,织梦网站图片alt属性自动调用标题就完成了,再也不用手动挨个添加图片alt属性了!
如果本文对你有帮助,欢迎打赏本站