Xataface CKeditor Module 0.3
CKeditor Widget for Xataface
Xataface CKeditor Module


This module adds an html editor widget that uses CKeditor to the set of widgets that can be used in a Xataface application. CKeditor is the successor of the FCKeditor project, which is included standard as part of the Xataface installation. The future of Xataface development is planned as modules so FCKeditor will continue to be used as the default editor for the htmlarea widget type. The CKeditor widget can be specified for any field by setting widget:type=ckeditor .

See also:

Table of Contents

  1. Requirements
  2. License
  3. Installation
  4. Basic Usage
  5. Configuration Options
  6. Plugin Development
  7. Schema Browser Plugin
  8. Support


  1. Xataface 2.0 (or SVN development trunk rev 3126 or higher)

Changes History

0.3 (January 26, 2012)

0.3 (January 26, 2012)


Installing the CKeditor module involves 2 steps:

  1. Copying the ckeditor directory into your application's (or xataface's) modules directory. I.e. the path should be modules/ckeditor.
  2. Adding the following line to the [_modules] section of your conf.ini file:

At this point you should be able to use the ckeditor widget in your application.

Basic Usage

Once the module has been installed, you can specify that a field use the CKeditor widget by setting its widget:type directive to "ckeditor" in the fields.ini file. E.g.


Now when you load up the edit form for that table, you should see a ckeditor widget for editing the myfield field.

See also:
http://docs.cksource.com/CKEditor_3.x/Users_Guide (The CKeditor Users Guide)

Configuration Options

CKeditor supports a many configuration options for setting such things as where the toolbar should appear and which buttons should be present on the toolbar. A full list of these options can be found at http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html

Many of these options can be specified in the fields.ini file by setting:




Per-Record Configuration

You can also customize the configuration of a CKEditor instance on a per-record basis by implementing the ckeditor_decorateConfig() method in the delegate class.


The following example sets the baseHref property of the editor be based on the record that is being edited.

function ckeditor_decorateConfig($record, &$config){
        $site = df_get_record('settings', array('settings_id'=>$record->val('settings_id') ));
        if ( $site ){
                $path = $record->val('webpage_url');
                if ( $path{strlen($path)-1} != '/' ){
                        if ( strpos($path, '/') !== false ){
                                $parts = explode('/', $path);
                                $path = implode('/', $parts);
                        } else {
                                $path = '';
                        $path .= '/';
                $baseurl = $site->val('website_url').$path;
                $config['baseHref'] = $baseurl;
Note It is very important that the 2nd parameter of this method is passed by reference (i.e. don't forget to prepend "&" to the argument definition.


See also:
 All Data Structures Files Functions Variables