Sharon
Sharon

Reputation: 3919

How do I modify the 'Format' dropdown in CKEditor?

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?

Upvotes: 13

Views: 14063

Answers (2)

Seb_CKSource
Seb_CKSource

Reputation: 116

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.

Upvotes: 1

Nick
Nick

Reputation: 6346

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

Upvotes: 29

Related Questions