如何在编辑商品和商品添加页面使用多个编辑器

创建时间:2019-11-26 16:01发布者:海誉_荷兰豆点击数:2394
由于业务需要,要在编辑商品界面和商品添加页面使用多个编辑器,需要怎么做呢?
回答 我也遇到这个问题(11)
二次开发,模板制作2019-12-02 03:01回答
论坛编辑器不好用,请查看这个文章解决:
http://0533hf.com/post/124
有用(0) 没用(0)
海誉_荷兰豆2019-12-21 11:54回答
问题解决,顺带解决官方外置上传图片插件:
/admin/template/product.html,表单
<dl>
<dt valign="top">{$lang.article_content}</dt>
<dd>
<!-- TinyMCE -->
<script type="text/javascript">init_editer('secontent', '{$cur}', '{$article.id}')</script>
<textarea id="secontent" name="secontent" rows="20">{$article.secontent}</textarea>
<!-- /TinyMCE -->
</dd>
</dl>


/admin/include/tinymce/init.js,添加函数:
function init_editer(selecter = 'content', module, item_id = ''){
console.log(item_id);
tinymce.init({
selector:'textarea#' + selecter,
language:'zh_CN',
width:'800px',
height:'360px',
menubar:false,
skin:'simple',
theme:'simple',
convert_urls :false,
automatic_uploads: false,
images_upload_url: 'file.php?rec=mce&module=' + module + '&item_id=' + item_id + '&type=' + selecter,
plugins: [
'autolink lists link charmap textcolor',
'code hr pagebreak map textpattern image imagetools',
'media table help wordcount fullscreen image'
],
toolbar: 'fontsizeselect bold italic strikethrough forecolor backcolor alignleft aligncenter alignright alignjustify outdent indent numlist bullist code | link unlink image media map charmap table hr removeformat undo redo help fullscreen'
});
}

/admin/file.php,添加文件上传的代码就可以了

elseif ($rec == 'mce') {
// hidden code , need contact qq:67052796
echo json_encode($html);
}
有用(0) 没用(0)
海誉_荷兰豆2019-12-22 08:28回答
完整代码:http://www.hzhaiyu.net/news/company-news/11.html
有用(0) 没用(0)