织站何自动但图片的梦网alt属性却很重要,下面给出方法让织梦模板自动给图片添加alt 。设置t属找到下面的图片添加代码  :


//设置全局环境变量 
$this->Fields['typename'] = $this->TypeLink->TypeInfos['typename']; 
@SetSysEnv($this->Fields['typeid'],$this->Fields['typename'],$this->Fields['id'],$this->Fields['title'],'archives');


在这段代码的下面添加下面的代码 :

//替换图片Alt为文档标题 
$this->Fields['body'] = str_ireplace(array('alt=""','alt='''),'',$this->Fields['body']); 
$this->Fields['body'] = preg_replace("@ [s]{ 0,}alt[s]{ 0,}=["'s]{ 0,}[sS]{ 0,}["'s] @isU"," ",$this->Fields['body']); 
$this->Fields['body'] = str_ireplace("Fields['title']."" ",$this->Fields['body']);


在后台重新生成html文件就会生效了。

使用dedecms建的织站何自动站默认不会给图片添加alt属性  ,

代开文件/include/arc.archives.class.php,梦网