欢迎来到资源库(www.zyku.net)

DedeCMS

当前位置:首页 > CMS教程 > DedeCMS > 编辑器

织梦kindeditor编辑器图片上传增加图片alt属性和title属性的方法

时间:2018-08-17|栏目:DedeCMS|点击:|我要投稿

织梦kindeditor编辑器图片上传增加图片说明alt属性和title属性效果图:

1、在织梦/include/kindeditor/kindeditor-all.js 或者 /kindeditor/kindeditor.js 或者 /kindeditor/kindeditor-min.js 找到图片按钮的代码:

'<div class="tab2" style="display:none;">',

在里面加入

'<div class="ke-dialog-row">',
'<label for="remoteTitle" style="width:60px;">' + lang.imgTitle + '</label>',
'<input type="text" id="remoteTitle" class="ke-input-text" name="title" style="width:200px;" />',
'<input id="autotitle" class="np" type="checkbox" onclick="if($(this).is(\':checked\')){$(this).prev().val($(\'#title\').val());}else{$(this).prev().val(\'\');}"> 使用文章标题',
'</div>',

2、kindeditor_post.php 或者 kindeditor\php\upload_json.php 找到:

echo $json->encode(array('error' => 0, 'url' =>

改成

$img_title = $_POST['title'];
echo $json->encode(array('error' => 0, 'url' => $activepath."/$mdir/".$filename_name, 'title'=>$img_title));

就是加了 img_title 而已,注意你的代码,不一定跟我上面的是一样的。在你的基础上加入而已。

(资源库 www.zyku.net)

关于我们 | 版权申明 | 寻求合作 |

重要申明:本站所有的文章、图片、评论等内容,均由网友发表或上传并维护或收集自网络,仅供个人学习交流使用,版权归原作者所有。

如有侵犯您的版权,请与我们联系,我们将在24小时内进行处理、任何非本站因素导致的法律后果,本站均不负任何责任。

联系QQ:95148658 | 邮箱:mb8#qq.com(#换成@)

苏ICP备2020066115号-1

本网站由提供CDN加速/云存储服务