How to setup FCKeditor

3 1
5
Viewed: 40 016 times
Version: Unknown (update)
Category: Tutorials
    Written by: krillzip krillzip
    Updated by: Dark-Sun Dark-Sun
    Created: Feb 8, 2009
    Updated: 14 years ago

    You are viewing revision #8 of this wiki article.
    This version may not be up to date with the latest version.
    You may want to view the differences to the latest version or see the changes made in this revision.

    « previous (#7)next (#9) »

    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)
        ) ); ?>
    

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

    Links

    Russian Version