fromtheflames
10-07-2011, 08:10 AM
Hi,
I want to share how to make customization to ckeditor.
Before upgrade to 417, I'd made some modification to ckeditor toolbar adding the templates button (in /vb/ckeditor.php) and modifying the default templates (in /clientscript/ckeditor/plugins/templates/templates/default.js).
After the upgrade, all went wiped out (files overwritten by default files).
So today, I looked to found a new way for retain customization to ckeditor: is as easy as adding a new plugin, using the hook editor_toolbar_set, with code like this:
$newButton = array('Templates');
$this->config['toolbar'][] = $newButton;
$newTemplateConfig = array('/clientscript/ckeditor/plugins/templates/templates/custom.js');
$this->config['templates_files'][] = $newTemplateConfig;
That's all!
Hopes it can help some of you...
I want to share how to make customization to ckeditor.
Before upgrade to 417, I'd made some modification to ckeditor toolbar adding the templates button (in /vb/ckeditor.php) and modifying the default templates (in /clientscript/ckeditor/plugins/templates/templates/default.js).
After the upgrade, all went wiped out (files overwritten by default files).
So today, I looked to found a new way for retain customization to ckeditor: is as easy as adding a new plugin, using the hook editor_toolbar_set, with code like this:
$newButton = array('Templates');
$this->config['toolbar'][] = $newButton;
$newTemplateConfig = array('/clientscript/ckeditor/plugins/templates/templates/custom.js');
$this->config['templates_files'][] = $newTemplateConfig;
That's all!
Hopes it can help some of you...