Remove menu and status bars in TinyMCE 4
Asked Answered
B

5

129

I am trying to remove the menu and status bars from TinyMCE 4 because I want to setup a very basic editor. Is this possible?

The documentation for TinyMCE 3 does not seem to be relevant and I cannot find anything for version 4.

Barbed answered 16/4, 2013 at 9:26 Comment(2)
well css you can do that easily !Poland
@ShivanshuSrivastava: you're kidding, right? :)Callable
B
285

I looked at the source and it was fairly obvious:

tinyMCE.init({
    menubar:false,
    statusbar: false,
        //etc
})

This removes both.

You can also customise what parts of the default menu bar are visible by specifying a string of enabled menus - e.g. menubar: 'file edit'

You can define your own menus like this:

menu : {    
    test: {title: 'Test Menu', items: 'newdocument'} 
},
menubar: 'test'
Barbed answered 16/4, 2013 at 9:45 Comment(4)
Small typo: menuBar: 'file edit' should be menubar: 'file edit'Ligetti
excellent! any idea how customize a specific textarea rather than all of'em?Ultrared
"any idea how customize a specific textarea rather than all of'em?" tinymce.init({ mode: "exact", elements: "IdOftextAreaEtc", where IdOftextAreaEtc is the id of the control to use for tinyMCEEdo
@DavidBridge, this syntax is for version 3.x. From 4.x, you can use the tinymce.init({ selector: "textarea#IdOfTextarea"}) (much like css syntax).Midwinter
G
31

If you want to remove entire Menu bar from top

tinymce.init({
    menubar: false,

});

But if you want Custom menubar with some submenu

tinymce.init({
    menu: {
        file: {title: 'File', items: 'newdocument'},
        edit: {title: 'Edit', items: 'undo redo | cut copy paste pastetext | selectall'},
        insert: {title: 'Insert', items: 'link media | template hr'},
        view: {title: 'View', items: 'visualaid'},
        format: {title: 'Format', items: 'bold italic underline strikethrough superscript subscript | formats | removeformat'},
        table: {title: 'Table', items: 'inserttable tableprops deletetable | cell row column'},
        tools: {title: 'Tools', items: 'spellchecker code'}
    }
});

see TinyMCE for more help.

Garwin answered 21/9, 2015 at 11:51 Comment(0)
H
7

So, It is clearly metioned in their docs that to make the values to false.

    tinymce.init({
    menubar: false,
    branding: false,
    statusbar: false,
   })

In the latest update to v5 You can display menubar as such

    tinymce.init({
     menu: {
      edit: { title: 'Edit', items: 'undo redo | cut copy paste pastetext | selectall searchreplace' },
      insert: { title: 'Insert', items: 'image link charmap pagebreak' },
      format: { title: 'Format', items: 'bold italic underline strikethrough superscript subscript | formats | removeformat' },
      table: { title: 'Table', items: 'inserttable tableprops deletetable | cell row column' }
    },
    menubar: 'edit insert format table',
});

see https://www.tiny.cloud/docs/ for more details

Harmaning answered 11/9, 2019 at 7:29 Comment(1)
I don't think it was clearly mentioned in their docs at the time the question was askedBarbed
C
5

If you want a completely clean text box, you could disable all the bars, including de "toolbar":

tinymce.init({
            selector:'textarea',
            branding: false,
            menubar:false,
            statusbar: false,
            toolbar: false,
        });
Ceremonious answered 24/3, 2021 at 22:33 Comment(0)
F
1

In the community edition I think you are not allowed to hide the statusbar (Powered by Tiny) branding part.

https://www.tiny.cloud/docs-4x/configure/editor-appearance/#branding

Fergus answered 24/2, 2021 at 14:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.