織夢kindeditor編輯器圖片上傳增加圖片alt屬性和title屬性的方法

2020-06-16 02:10:40 來源:互聯(lián)網(wǎng)作者:佚名 人氣: 次閱讀 194 條評論

 文章主要介紹了織夢kindeditor編輯器圖片上傳增加圖片alt屬性和title屬性的方法,下面是通過網(wǎng)絡(luò)收集整理的方法教程,給大家做個參考??棄鬹indeditor編輯器圖片上傳增加圖片...

 文章主要介紹了織夢kindeditor編輯器圖片上傳增加圖片alt屬性和title屬性的方法,下面是通過網(wǎng)絡(luò)收集整理的方法教程,給大家做個參考。

織夢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(\'\');}"> 使用文章標(biāo)題',
'</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 而已,注意你的代碼,不一定跟我上面的是一樣的。在你的基礎(chǔ)上加入而已。

以上是整理的織夢kindeditor編輯器圖片上傳增加圖片alt屬性和title屬性的方法全部代碼內(nèi)容,希望文章能夠幫你解決所遇到的程序開發(fā)問題。