首先在需要使用編輯器的頁面添加如下代碼:
<textarea class="content" name="content2" rows="20">{$article.content}</textarea>
打開admin/include/tinymce/init.js 將代碼修改如下
/**
+----------------------------------------------------------
* tinymce初始化
+----------------------------------------------------------
*/
tinymce.init({
selector:'textarea#content,textarea.content',
language:'zh_CN',
width:'800px',
height:'360px',
menubar:false,
skin:'simple',
theme:'simple',
convert_urls :false,
plugins: [
'autolink lists link charmap textcolor',
'code hr pagebreak map textpattern image imagetools',
'media table help wordcount fullscreen'
],
toolbar: 'fontsizeselect bold italic strikethrough forecolor backcolor alignleft aligncenter alignright alignjustify outdent indent numlist bullist code | link unlink media map charmap table hr removeformat undo redo help fullscreen'
});
/**
+----------------------------------------------------------
* tinymce插入HTML
+----------------------------------------------------------
*/
function insertMce(html) {
tinyMCE.execCommand('mceInsertContent', false, html);
}
由二次開發,模板制作于2019-12-02 04:06回答
關于第二個編輯器如何上傳圖片的問題,把光標移到第二個編輯器上,此時上傳的圖片會默認傳到第二個編輯器里。如有任何使用問題,請留言
有用(0) 沒用(0)