Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add toolbar item to default toolbar

Tags:

tinymce-4

I just want to add an item to default tinymce config, something like this:

tinymce.init({
  selector: "textarea",
  plugins: "customimageupload",
  toolbar: tinymce_default_toolbar + " customimageupload"
});
like image 328
MuriloKunze Avatar asked Dec 12 '25 05:12

MuriloKunze


1 Answers

There is no way to set the toolbar based on the "default" toolbar. If you use the toolbar setting you need to explicitly mention all the items you want. From looking at the source code of the editor the default toolbar is:

var defaultToolbar = "undo redo | styleselect | bold italic | alignleft" 
                   + "aligncenter alignright alignjustify | " 
                   + "bullist numlist outdent indent | link image";

Do note that at least some of these options would need a plugin loaded before they appear (e.g. the list related buttons).

For future reference this information on the default toolbar is found in the following file: tinymce/themes/modern/theme.js

like image 169
Michael Fromin Avatar answered Dec 17 '25 00:12

Michael Fromin