Yii Framework Forum: CKEditor customization - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

CKEditor customization How to customize the installation of CKEditor? Rate Topic: -----

#1 User is offline   cshehadi 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 30
  • Joined: 10-July 09

Posted 26 October 2009 - 04:42 PM

Hi,

I downloaded the extension for using CKEditor - but I can't seem to get it to use the custom.js file, or to be able to set custom properties through Yii.

For instance, if I uncomment the two default configuration lines in ckeditor/assets/config.js...

CKEDITOR.editorConfig = function( config )
{
config.language = 'fr';
config.uiColor = '#AADC6E';
};

I ought to see a different background color, and my default language should be french - but no such luck.

I tried setting up a custom configuration file through the Yii widget interface, but it says it's not a property of the widget:

for instance, using this...

<?php $this->widget('application.extensions.ckeditor.CKEditor', array(
'model'=>$model,
'attribute'=>'OneLineStory',
'editorTemplate'=>'basic',
'customConfig'=>'/custom/ckeditor_config.js'
)); ?>

gives me the following CException:

Property "CKEditor.customConfig" is not defined.

Is there a way to set up a config.js file somewhere (a custom one would be ideal) so I can have the full range of CKeditor customizations?

-Charlie
0

#2 User is offline   zegarmistrz001 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 34
  • Joined: 06-April 09

Posted 08 November 2009 - 02:49 PM

I have this problem too and i find one way.

1. open file "protected/extensions/ckeditor/CKEditor.php"
2. find code:
$js =<<<EOP
CKEDITOR.replace('{$name}',{$options}); 
EOP;

3. append your changes. For example:
$js =<<<EOP
CKEDITOR.replace('{$name}',{$options}); 
CKEDITOR.config.toolbar_Full = [
['Source'],
['Format','Font','FontSize'],
['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
 ];
EOP;

0

#3 User is offline   cshehadi 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 30
  • Joined: 10-July 09

Posted 10 November 2009 - 11:27 AM

thanks - you can also use the newly uploaded extension: NHCKEditor
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users