I'm trying to set settings in a custom module using hook_ckeditor_settings_alter()
but the hook isn't being called on `admin/config/content/ckeditor/edit/Advanced` or `admin/config/content/ckeditor/edit/Basic` at all, so what shows in the UI is completely wrong. I'm not really sure what I expected since that's usually what _alter hooks usually do...
Better question: What's the recommended way to replace ckeditor.config.js
, including all the defaults that are provided for the settings form? (and please don't say to put that in the theme...)
I had found an example somewhere that recommended the following approach but I'm unable to replace the toolbars this way.
function example_ckeditor_settings_alter(&$settings, $conf) {
// Change the ckeditor config path.
$settings['customConfig'] = drupal_get_path('module', 'example') . '/ckeditor.config.js';
}
Comments
Comment #2
jenlamptonComment #3
jenlamptonComment #4
morsokFrom what i've seen so far, I think the hook is simply never called !
Comment #5
vinmassaro CreditAttribution: vinmassaro commented@jenlampton: it appears that the hook is called when the CKEditor settings are compiled, which is when the editor is loaded. This doesn't happen when loading a configuration page for the module. I implemented
hook_ckeditor_settings_alter()
in a custom module and addeddpm($settings);
to it. If I load a node edit or create page and then refresh it again, I can see the $settings array, so this hook does get called properly.Overriding the config as documented should work.