Jump to content

CKEditor: how to adapt config.js and keep it upgradeable


titanium
 Share

Recommended Posts

Dear ProcessWire experts,

I would like to add some configuration options to CKEditor, like "config.startupOutlineBlocks = true;"

Its easy to add that to /wire/modules/Inputfield/InputfieldCKEditor/ckeditor-4.4.3/config.js. But how do I keep it upgradeable? I suppose the next time the module is upgraded my custom config.js will be gone, right?

TIA

Link to comment
Share on other sites

Custom configurations are now in  /site/modules/InputfieldCKEditor/. I am guessing you know that now CKEditor is the default editor in PW (see dev branch)

I am guessing but not sure that you could also add your custom config.js to that directory instead?

Have a read here:

http://www.flamingruby.com/blog/processwire-weekly-13/ [see Upgrades to CKEditor]

https://github.com/ryancramerdesign/ProcessWire/tree/dev/site-default/modules/InputfieldCKEditor

Link to comment
Share on other sites

Yes, I'm using the latest dev (2.4.12 at times).

I've thrown my custom config.js in /site/modules/InputfieldCKEditor, but unfortunately this does not work.

Then I tried to copy the whole "ckeditor-4.4.3" subdirectory to /site/modules/InputfieldCKEditor and put my custom config.js in it (overwriting the one from /wire...), but this doesn't work either.

Link to comment
Share on other sites

This isn't currently supported and needs a new option for CKEditor module to work. CKEditor itself has support for custom config file. So far I can't see why this wouldn't be doable, either.

This is how config load order is explained in the CKEditor docs:

  • An editor instance is created. At this point all its default configuration options are set.
  • If the customConfig setting has been set "in-page", that file is loaded, otherwise the default config.js file is loaded. All settings in the custom configuration file override current instance settings.
  • If the settings loaded in step 2 also define a new customConfig value, another custom configuration file is loaded and its settings override current instance settings. This happens recursively for all files until no customConfig is defined.
  • Finally the settings defined "in-page" override current instance settings (except customConfig, which has been used in step 1).

I'll also have to agree that this is very important option to have. Config.js (in one form or another) is meant to be customised.

  • Like 3
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...