Page 1 of 2

How to remove the "file" menu

PostPosted: 24 Apr 2018 06:31
by davenovo
Hello,
How do I remove the file menu item from the tinyMCE editor? Right now it only has "New Document" under there and I dont want to see that, or the file menu.

Re: How to remove the "file" menu

PostPosted: 24 Apr 2018 11:32
by Jorge Sousa
TinyMCE.TinyMCEOptions.EditorAppearance.MenuBar

more info @

https://stackoverflow.com/questions/16033321/remove-menu-and-status-bars-in-tinymce-4

TinyMCE.TinyMCEOptions.EditorAppearance.Menu

Re: How to remove the "file" menu

PostPosted: 24 Apr 2018 22:34
by davenovo
Hello Jorge,

Maybe I am missing something. In the EditorAppearance I just have the following

Capture.PNG


Under the Items menu the combo box is empty, even if I drop it down. If I type anything into the "items" or "title" under file, it makes the entire menu go away, both in the IDE and at runtime.

I had expected to see a visible property or something but there is nothing there. It is not obvious how to make the file menu go away. Sorry, I am not a javascript programmer :o

Re: How to remove the "file" menu

PostPosted: 25 Apr 2018 16:01
by Jorge Sousa
Hi

The combos shouldn't be there, but have no influence on the code

if you follow the TinyMCE link posted in the link i posted before:

You will find this

https://www.tinymce.com/docs/advanced/editor-control-identifiers/#menucontrols

If you insist that you have to know javascript, to understand it well I'm sorry to hear that. I you feel disappointed just lets us know

Re: How to remove the "file" menu

PostPosted: 25 Apr 2018 16:12
by davenovo
H Jorge,

Are you trying to say that I cannot remove the file menu using the Object Inspector in the IDE? That I have to somehow use javascript directly to hide the file menu?

I see from the original post from stack overflow that I can

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'


I think that has to go in the "tinymce.init"

How do I make a custom tinymce.init?

Also, as a suggestion, if you can give an easy way to turn off/on the default menus, like you give an easy way to turn off/on the plugins, that would be very helpful.

Re: How to remove the "file" menu

PostPosted: 25 Apr 2018 16:14
by davenovo
In the screenshot above, what is the title property supposed to do. If I type anything into it, then it makes the entire top menu dissapear.

Re: How to remove the "file" menu

PostPosted: 25 Apr 2018 21:05
by Jorge Sousa
Hi

The title property should contain a string with the name of the menu. The items field should contain a space separated list of the controls that should populate the menu.


from

https://www.tinymce.com/docs/configure/editor-appearance/#menu

Re: How to remove the "file" menu

PostPosted: 25 Apr 2018 22:44
by davenovo
I am sorry, but there must be a bug. I have entered the text as you describe (show below), and all that happens is that the entire top menu dissapears.

Capture.PNG


However, even if that worked, that only shows me how to customize the menu. I want to make the file menu not appear at all (but leave the other menu items as default). How can I do that?

Re: How to remove the "file" menu

PostPosted: 25 Apr 2018 23:29
by Jorge Sousa
it would work if you put the allowed strings in items property

[url]https://www.tinymce.com/docs/advanced/editor-control-identifiers/#menucontrols
[/url]

However, even if that worked, that only shows me how to customize the menu. I want to make the file menu not appear at all (but leave the other menu items as default). How can I do that?


I told you before, my first reply

by Jorge Sousa ยป Tue, 24 Apr 2018, 12:32

TinyMCE.TinyMCEOptions.EditorAppearance.MenuBar


more info @
https://www.tinymce.com/docs/configure/editor-appearance/#menubar

Re: How to remove the "file" menu

PostPosted: 26 Apr 2018 00:32
by davenovo
Sorry. I somehow read "Menu" when you said "Menubar". My fault.

However, can you please explain what I am doing wrong here. Note that I have set tmcembFile to false, yet is it still appearing in the IDE and at run time

Capture.PNG


In fact, it is a little confusing because the default for all the MenuBar items are False, even though by default all the Menu bar items appear in the editor.