Yii 1.1: How to setup FCKeditor

5 followers

updated version of this article which works with CKEditor 3.x here

To start with you need to download the latest stable release of FCKeditor. Extract the downloaded file and place the fckeditor/ folder in your applications webroot directory.

Next to do is to download the Yii FCKeditor extension, created by Ascomae. Extract the downloaded file, and place the fckeditor/ widget folder in your web applications protected/extensions/ directory.

Configuring the FCKeditorWidget

In the view where you want to use the FCKeditorWidget:

<?php $this->widget('application.extensions.fckeditor.FCKEditorWidget',array(
    "model"=>$pages,                # Data-Model
    "attribute"=>'content',         # Attribute in the Data-Model
    "height"=>'400px',
    "width"=>'100%',
    "toolbarSet"=>'Basic',          # EXISTING(!) Toolbar (see: fckeditor.js)
    "fckeditor"=>Yii::app()->basePath."/../fckeditor/fckeditor.php",
                                    # Path to fckeditor.php
    "fckBasePath"=>Yii::app()->baseUrl."/fckeditor/",
                                    # Realtive Path to the Editor (from Web-Root)
    "config" => array(
        "EditorAreaCSS"=>Yii::app()->baseUrl.'/css/index.css',),
                                    # http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/Configuration/Configuration_Options
                                    # Additional Parameter (Can't configure a Toolbar dynamicly)
    ) ); ?>
  • the model property is the instance of the Model to be associated with.
  • attribute the Model attribute to be associated with.
  • fckeditor, the path to the fckeditor php file.
  • fckBasePath, the url to the editor frontend to be loaded inside the iframe.
  • config Most parameter in the fckconfig.js can be changed within this config. http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/Configuration/Configuration_Options

If those instructions have been followed exactly the FCKeditor should work correctly.

Links

Russian Version

updated version of this article works with CKeditor 3.x

Total 2 comments

#9018 report it
Dark-Sun at 2012/07/13 03:19am
an updated version of this extension which works with CKeditor 3
#3284 report it
grigori at 2011/03/31 08:45am
this does not work

This is a useless article that does not work even with the old FCKEditor.

Leave a comment

Please to leave your comment.

Write new article
  • Written by: krillzip
  • Updated by: Dark-Sun
  • Category: Tutorials
  • Yii Version: 1.1
  • Votes: +3 / -1
  • Viewed: 15,733 times
  • Created on: Feb 8, 2009
  • Last updated: Jul 13, 2012