CKEditor, modify Format drop-down

Oct 26, 2011 at 2:34 PM

Hi,

Firstly I only just stumbled across this editor and am upgrading from FCK which is dated, this is much improved and mends all sorts of things so I'm very happy !

The RadEditor doesnt do various things and seems bloaty so I will stick with CKeditor despite DNN going down the Rad route.

Please can you assist me in working out how to change the contents of the 'Format' drop-down. I'd like to restrict this to certain things rather than the list given.

Many thanks

Rob

Oct 26, 2011 at 3:01 PM

You need to modify the config file... take a look here...

http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.format_tags

You can modify the Custom Config.js file in the Editor Folder, or create your own and specify this config in the editor settings.

 

Oct 27, 2011 at 12:27 PM

Thanks, that document is really helpful, I’ve set config.format_tags ='p;h1;h2;h3;h4'; in the config file and that works great.

Now, all I need to do is change the toolbars around a bit. I see how the FULL and BASIC toolbars are created in /plugins/toolbar/plugin.js,

and I also see how I should be able to alter them using config.toolbar_Full = and config.toolbar_Basic = in the config file.

 So to try it out I set them

                    

            config.toolbar_Full =

            [

            { name: 'document',   items : [ 'Source','-','Save','NewPage','DocProps','Preview','Print','-','Templates' ] }

            ];

 

            config.toolbar_Basic =

            [

            { name: 'document',   items : [ 'Source','-','Save','NewPage','DocProps','Preview','Print','-','Templates' ] }

            ];

 

And cleared browser cache, restarted DNN, refreshed editor, etc – and no change.

(1) What did I miss here ?

 

Also still in the config file I created a new toolbar :

 

config.toolbar_Fish =

            [

                  { name: 'document',   items : [ 'Source','-','Save','NewPage','DocProps','Preview','Print','-','Templates' ] }

            ];

 

And set it to default:

            config.toolbar = 'Fish';

 

However this didn’t show up at all, either as the toolbar shown to me, but also it didn’t show up in the toolbars list in the custom editor options.

(2)What did I miss here ?

 

(3)Where does the ‘Standard’ toolbar come from ? And how do I change what is on it ? 

 

Many thanks

 

Rob

Oct 27, 2011 at 12:49 PM

The Toolbars are managed from the Editor Options Window. Bellow the Editor there is an Link To Open The Options "Custom Editor Options". On that Page you can Modify/Create/Delete Toolbars.

Oct 27, 2011 at 2:14 PM

OK, So I can drop a CKToolbar.XML into each Portal root, I was just after a way to do this programatically at the config level for _all_ portals in one go rather than individually for each Portal.

The help gives the impression that these can be set in the config file, but this seems to get ignored, hence my question above  .....

Oct 28, 2011 at 3:19 PM
robnisbet wrote:

OK, So I can drop a CKToolbar.XML into each Portal root, I was just after a way to do this programatically at the config level for _all_ portals in one go rather than individually for each Portal.

The help gives the impression that these can be set in the config file, but this seems to get ignored, hence my question above  .....

The Reason why its ignoring the config.js about the Toolbars, because there is a setting where you can choose a toolbar for Each Role individually.

But maybe i should place the Default CKToolbar.xml in the _default Portal Folder.