I realize this is more a question about using CKEditor 4.5 than a wysiwyg question, but I think the solution to this question would help a lot of folks out. Using wysiwyg 7.x-2.2+63-dev with the CKEditor 4.5.1 full library, I am looking to remove the Advanced tab from the image pop-up dialogue box. Can anyone suggest the best way to do this without necessarily editing any of the CKEditor files? I'd like to preserve the change for the next potential update to CKEditor 4.5.2 for example.

Please see the screenshot attached for exactly what I am looking to remove.

The answer might involve using the code from CKEditor 4 Documentation, which suggests:

config.removeDialogTabs = 'link:target;link:advanced;image:Link;image:advanced';

I initially tried to add this to the config.js file in the library, like so, but it didn't seem to have any effect after clearing all caches:

CKEDITOR.editorConfig = function( config ) {
	// Define changes to default configuration here. For example:
	// config.language = 'fr';
	// config.uiColor = '#AADC6E';
	config.removeDialogTabs = 'link:target;link:advanced;image:Link;image:advanced';
};

Can anyone suggest a working way to do this, and again, if possible how to implement in a way that would carry over to future updates with CKEditor 4.x? Thanks.

CommentFileSizeAuthor
#1 ckeditor-451-remove-tab.jpg73.04 KBrajmataj
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rajmataj’s picture

FileSize
73.04 KB
TwoD’s picture

Status: Active » Fixed

Wysiwyg does not load config.js so no changes there will have any effect.
Implement hook_wysiwyg_editor_settings_alter() in a small Drupal module instead.

/**
 * Implements hook_wysiwyg_editor_settings_alter().
 */
function MYMODULE_wysiwyg_editor_settings_alter(&$settings, $context) {
  if ($context['profile']->editor == 'ckeditor') {
    $settings['removeDialogTabs'] = 'link:target;link:advanced;image:Link;image:advanced';
  }
}

No need to modify any of the CKEditor files so this will still work when upgrading the CKEditor library.

rajmataj’s picture

Fantastic! Thank you so much TwoD. Works like a charm.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

Stephen Ollman’s picture

Excellent, the module solution worked for me with the CKEditor version of 4.6.1, although it's IMPORTANT to note the capitalisation of 'image:Upload' & 'image:Link' as these are required for it to work with the image dialog tab.