Php – How to modify the ‘Format’ dropdown in CKEditor

ckeditorPHP

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?

Best Answer

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';