Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove advanced tab from CKEditor - WYSIWYG

The wysiwyg-editor from http://CKEditor.com has too many buttons and is cluttored for many users. so I decided to remove unnecessary tabs and button. So I would like to remove the Advanced tab from the image uploader. Any suggestion how to do it?

enter image description here

like image 932
C graphics Avatar asked Sep 27 '12 23:09

C graphics


4 Answers

It appears there are two methods of doing this;

1: Edit your CKEditor config definition(config.js):

config.removeDialogTabs = 'image:advanced';

Remember; the config setting is case-sensitive.

2: You can of course also do this in-line so you can refer to it by editor:

CKEDITOR.replace( 'editor_kama',
{  //                  ^---Editor Id goes here
    removeDialogTabs : 'image:advanced'
});
like image 135
Daedalus Avatar answered Oct 11 '22 15:10

Daedalus


Try this in plugins/images/dialog/image.js

id : 'advanced',
               label : editor.lang.common.advancedTab,
               hidden : true,
               elements :

Adding the hidden : true should work. Or you could try:

yourDialogDefinition.getContents('advanced').hidden=true;
like image 41
Sudhir Bastakoti Avatar answered Oct 11 '22 13:10

Sudhir Bastakoti


It appears that config.removeDialogTabs = 'image:advanced'; does not work anymore - or at least it did not work for me. But there are instructions if the official documentation on how to edit dialogs. Based on those instructions, I use this solution:

CKEDITOR.on('dialogDefinition', function (ev) {
    var dialogName = ev.data.name,
    dialogDefinition = ev.data.definition;

    if (dialogName === 'image') {
        dialogDefinition.removeContents('advanced');
        dialogDefinition.removeContents('link');
    }
});
like image 35
Joel Peltonen Avatar answered Oct 11 '22 13:10

Joel Peltonen


Since the removeDialogTabs doesn't work anymore, the latest way of hiding the tab is simply:

linkShowAdvancedTab = false

in the config. This works in version 4.13 at least.

like image 39
DeclanMcD Avatar answered Oct 11 '22 13:10

DeclanMcD