Yii 1.1: extckeditor

Yii Ckeditor based in Ckeditor extension created by Ekstazi
9 followers

Yii ExtCkeditor based in Ckeditor extension created by Ekstazi http://www.yiiframework.com/extension/ckeditor/

Requirements

Tested in Yii 1.1.8

Usage

Download ckeditor source http://ckeditor.com/download tested with 3.6.2 version, unzip in assets folder:

proteted/extensions/extckeditor/assets/ckeditor.js
proteted/extensions/extckeditor/assets/config.js
proteted/extensions/extckeditor/assets/lang/
... etc.

in the view

<?php $this->widget('application.extensions.extckeditor.ExtCKEditor', array(
'model'=>$model,
'attribute'=>'body', // model atribute
'language'=>'en', /* default lang, If not declared the language of the project will be used in case of using multiple languages */
'editorTemplate'=>'full', // Toolbar settings (full, basic, advanced)
)); ?>

Total 7 comments

#16121 report it
Jonathan Morales Salazar at 2014/01/21 03:43pm
disabled

how can I do my ckeditor disabled?

#7748 report it
Cstdenis at 2012/04/14 08:03am
how is it different?

You say "based in Ckeditor extension created by Ekstazi". In what way is it better/different from Ekstazi's extension?

#7591 report it
undsoft at 2012/04/01 04:34pm
Custom toolbar

The "advanced" toolbar is there to define 'custom' toolbars.

Example:

'editorTemplate'=>'advanced',
'toolbar'=>array(
     array('Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink','-','Image','Flash', '-', 'About')
),
#7482 report it
jwinn at 2012/03/25 05:26pm
Custom Toolbars

Note that there is no 'advanced' toolbar. You can add this custom toolbar using config.js, and will need to include this file yourself.

$cs->registerScriptFile($assets.'/config.js');

When first editing and saving the config.js, for some reason it was cacheing even after hard refreshes (locally), not sure why. Eventually the JS asset updated and the new toolbar was available. If you want to add other toolbar names, you will need to add to $allowedEditorTemplates

Also - Height Not Used The height option is not used in makeOptions. I added

$options['height'] = $this->height;
#7407 report it
mariusn at 2012/03/21 05:23am
FIX

As per Gsoul's post, in EXTCKEditor.php, around line 90, it should be

if(isset($this->allowedLanguages[$lang]))
  $this->language=$lang;
#6340 report it
Cherif at 2011/12/30 06:52pm
Error in line 90 undifined variable $language

There is an error in the code in setLanguage function I correcte it to $lang instead of $language that is not defined and it works fine. Nice Widget it saved me time Thank you

#6332 report it
samdark at 2011/12/30 11:58am
Merge code?

Maybe it's better to merge code of these two? Ekstazi's one is now part of YiiExt: https://github.com/yiiext/ckeditor-widget

Leave a comment

Please to leave your comment.

Create extension