4

I'm using the CKEditor module and I need to adjust config.js in the module's root. The problem is I don't want to make changes to any files part of the module because all those changes will get blasted when I do a code update.

How can I apply changes to CKEditor's config.js without modifying the module's copy of config.js?

3

Can you add the setting inside the Custom JavaScript configuration field of the Advanced Options for a particular profile?

There's also the ability to load your own custom config.js file in the 'Load ckeditor.config.js from the theme path' setting under the 'Advanced' section in the CKEditor profile settings.

  • I upvoted your answer – B2F Sep 29 '14 at 21:07
1

Well, since you are not using the WYSIWYG module but the CKEditor module, you can put a ckeditor.plugin.js in your theme root dir.

You will then have to check the "Load ckeditor.config.js from the theme path" radio button in your module Advanced Options. It is located at /admin/config/content/ckeditor/edit/"Profile" and read:

When enabled, the editor will try to load the ckeditor.config.js file from the theme directory.

You could also put string settings in the "Custom JavaScript configuration" UI area directly.

Edit: in short you could have accepted "geerlingguy" answer back then, I would have noticed it.

0

If you use the WYSIWYG module you can install CKEditor as a library and then it is separate from the module code.

EDIT: As Lester pointed out, this wont work out of the box, see my answer on his other post WYSIWYG CKEditor config.js not being used?

0

Add a custom javascript to your theme/module with next content:

(function ($) {
  Drupal.behaviors.MYMODULE = {
    attach: function () {
      if (CKEDITOR !== undefined) {
        // Extend CKEDITOR.config here...
        // For example:
        CKEDITOR.config.wordcount = {
          showWordCount: true,
          showCharCount: true
        }
      }
    }
  }
}(jQuery));

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.