I'm trying to modify the 'Format' drop down in CKEditor, and I think I've followed all the instructions properly, but it's not working.
I went to _source/plugins/format/plugin.js and changed
CKEDITOR.config.format_tags = 'p;h1;h2;h3;h4;h5;h6;pre;address;div';
to
CKEDITOR.config.format_tags = 'h1;h2;div;p';
When I add a 'Format' drop down though, I still get all the original options in there (p;h1;h2;h3;h4;h5;h6;pre;address;div
) instead of just the ones I listed.
Am I editing the wrong file or something? Or do I need to do something else to make it realise that the option has changed?
The main configuration file is named config. js . This file can be found in the root of the CKEditor 4 installation folder.
var editor = CKEDITOR. replace( 'editor' ); // Add dynamic css text to be used by the editing area. editor. addCss( 'body { background-color: grey; }' );
CKEditor 4 has plugin-based architecture. In fact, initially the editor core is an empty box, which is then filled with features provided by plugins. Even the editor interface, like toolbars, buttons, and the editing area, are plugins, too!
You should edit your config file, not the plugin file.
Should be in the root of the ckeditor
folder, config.js
Should start with:
CKEDITOR.editorConfig = function( config )
{
So you would want to add this to it (after the above, but before the closing }
):
config.format_tags = 'h1;h2;div;p';
Nick is right. You shouldn't touch the source folder. Just use the config.js file located in ckeditor root. Also refer to the CKEditor API page for further customization options and the developer guides here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With