Remove menu and status bars in TinyMCE 4

后端 未结 3 1422
闹比i
闹比i 2020-12-13 01:44

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

相关标签:
3条回答
  • 2020-12-13 02:11

    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

    0 讨论(0)
  • 2020-12-13 02:13

    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.

    0 讨论(0)
  • 2020-12-13 02:33

    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'
    
    0 讨论(0)
提交回复
热议问题