CKEditor Configuring

Created by: Lester Caine, Last modification: 23 May 2011 (21:56 UTC) by Alan Iroff
The CKEditor documentation carries a complete list of the available config settings. These can be overridden in the bitweaver local config file, or in a private config file provided with a theme. It is a good idea to clear both the bitweaver cache and the browser cache when changing config settings a the relevant file may not get update automatically. The usual problem with config changes not working in general is that cached copies are still in the delivery chain.

Config Location

The default location for the CKEditor config file is /ckeditor/ckconfig.bitweaver.js, but by using the 'Custom Config File' option in the CKEditor settings page, this can be moved to the theme setup. /ckeditor/ckconfig.custom.js is selected in place of the default config but if it is copied to /themes/styles/<style>//ckeditor/ckconfig.custom.js, then that version is loaded instead. The initial custome file is simply a copy of the bitweaver version, which can be copied as the basis for new configurations.

Toolbars

The basic and full toolbar configurations are provided by the core toolbar plugin, while 4 additional toolbars are managed via /ckeditor/ckconfig.bitweaver.js which can be modified to personal taste, or additional toolbar layouts can be added, but will need to be include in the /ckeditor/admin/admin_ckeditor_inc.php drop down to allow selection.

/ckeditor/ckconfig.bitweaver.js


<?php
CKEDITOR
.editorConfig = function( config ) {

/* Start of BITWEAVER toolbar sets */
config.toolbar_Supported = [
    [
'Source','-','Preview'],
    [
'Cut','Copy','Paste','PasteText','PasteFromWord','-','Print','SpellChecker'],
    [
'Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
    
'/',
    [
'Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
    [
'NumberedList','BulletedList','-','Outdent','Indent'],
    [
'JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
    [
'Link','Unlink','Anchor'],
    [
'Table','HorizontalRule','Smiley','SpecialChar','PageBreak'],
    
'/',
    [
'Styles','Format','Font','FontSize'],
    [
'TextColor','BGColor'],
    [
'Maximize','ShowBlocks','-','About']
];

};
?>

toolbar_Supported is an editable replacement for the 'full' and should b use when a full set of tools is required in bitweaver. Beginner, Intermediate and Advanced provide three other subsets of tools.

Layout

One of the nice feature added in CKEditor is the ability to expand the text area. This is enabled by default, but it's minimum sizes may cause problems in some themes and browser sizes.
resize_enabled=false will disable the drag box on the bottom right, while
resize_minWidth and resize_minHeight allow these dimentions to be changed. An additional option, resize_dir, allows the direction of resize to be locked to horizontal or mor usefully for bitweaver, vertically. These values can be added to the /ckeditor/ckconfig.bitweaver.js file

/ckeditor/ckconfig.bitweaver.js


<?php
config
.resize_minWidth 400;
config.resize_minHeight 300;
config.resize_dir 'vertical';
};
?>


Plugins

Next on the TODO list ...
Not sure as yet how to rework the existing fck plugins. split has been ported, but needs modifying, and attachments needs a major rebuild. But adding plugins seems to be working OK. config.extraPlugins = 'myplugin,anotherplugin'; is added to the ckconfig file, and 'myplugin' can then be added to the tool sets as required. </style>