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

由海誉_荷兰豆于2019-12-21 11:54回答

问题解决,顺带解决官方外置上传图片插件:

/admin/template/product.html,表单

{$lang.article_content}

{$article.secontent}

/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)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值