admin管理员组文章数量:1394228
I am trying to add a link/unlink and image button to my TinyMCE editor. Now I have the following code:
tinymce.init({
selector: 'textarea', // change this value according to your HTML
toolbar1: 'link unlink image',
toolbar2: 'undo redo | styleselect | bold italic | link | alignleft aligncenter alignright'
});
However its showing an empty first toolbar. Please see my fiddle: JSFiddle
I am trying to add a link/unlink and image button to my TinyMCE editor. Now I have the following code:
tinymce.init({
selector: 'textarea', // change this value according to your HTML
toolbar1: 'link unlink image',
toolbar2: 'undo redo | styleselect | bold italic | link | alignleft aligncenter alignright'
});
However its showing an empty first toolbar. Please see my fiddle: JSFiddle
Share Improve this question asked Mar 11, 2016 at 10:19 Arko ElsenaarArko Elsenaar 1,7394 gold badges18 silver badges36 bronze badges3 Answers
Reset to default 7You have used two toolbars though the issue seems to be with plugins, try instead using below:
tinymce.init({
selector: 'textarea', // change this value according to your HTML
plugins: [
"advlist autolink lists link image charmap print preview anchor",
"searchreplace visualblocks code fullscreen",
"insertdatetime media table contextmenu paste"
],
toolbar: 'undo redo | styleselect | bold italic | link | alignleft aligncenter alignright | link image',
});
DEMO
You just need to add needed plugins:
tinymce.init({
selector: 'textarea', // change this value according to your HTML
toolbar1: 'link unlink image',
toolbar2: 'undo redo | styleselect | bold italic | link | alignleft aligncenter alignright',
plugins: ["link image"],
});
Default icons are required to be imported in TinyMCE 5.3 or above.
import 'tinymce/icons/default';
Here are the references:
- TinyMCE Official Doc https://www.tiny.cloud/docs/advanced/usage-with-module-loaders/
本文标签: javascriptTinyMCE some buttons are not showing upStack Overflow
版权声明:本文标题:javascript - TinyMCE some buttons are not showing up - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744084173a2588205.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论