Remove TinyMCE Toolbar

How to remove a button from the TinyMCE toolbar?

Am I directly editing tiny_mce.js file? If so, where? Is my editor_template.js file editable?

Any instruction or tips would be appreciated.

+3
source share
2 answers

You can pinpoint what you want on the toolbar, with an extended theme, and you can simply specify a list of buttons. See http://wiki.moxiecode.com/index.php/TinyMCE:Configuration for a link to configuration or examples at http://tinymce.moxiecode.com/examples/full.php

+4
source

If you need to remove a button dynamically, you can use the following technique:

    tinymce.init({
        selector: "textarea",
        toolbar: "custom",
        formats: {custom: {inline: "span", styles: {color: "red"}}},
        setup: function(editor){

            editor.addCustomButton = function () {
               if(this.customButton){
                   this.customButton.show();
               } else {
                   this.addButton("custom", {
                       onpostrender: function() {
                           editor.customButton = this; //saving button reference
                       }
                   });
               }
            };

            editor.removeCustomButton = function () { this.customButton.hide(); };
        }
    });

addCustomButton removeCustomButton removeCustomButton .

0

Source: https://habr.com/ru/post/1743350/


All Articles