Apostrophe 1.5: legacy documentation

Still using Apostrophe 1.5? Check out Apostrophe 2 for your future projects.

apostrophe Ck Editor Plugin

apostropheCkEditorPlugin

This plugin lets you use the newer CKEditor with Apostrophe. It is the new default in our sandbox and therefore in our own new projects. You can easily upgrade your existing projects.

Known Issues

  • We fixed a bug with percentage widths and the kama skin in our own version, "aDefault," so that's the default skin you get. Not really a problem, just something to be aware of
  • I have not made a spellchecker available because ckeditor's spellchecker is an ad-supported product from spellcheck.net, probably not something our clients want.  Maybe this option will mature
  • Be aware you will be migrating any fckextraconfig.js settings to app.yml as described below

Installation

1. Fetch the plugin via svn from:

http://svn.apostrophenow.org/plugins/apostropheCkEditorPlugin/trunk

We recommend adding it to the svn:externals of your plugins folder so you get updates. But you can just svn export that URL to download a copy now without any further use of svn.

2. Add this plugin and enable it in ProjectConfiguration.class.php

3. Set app_a_editor to ck in app.yml:

all:
  a:
    editor: ck

4. symfony plugin:publish-assets

5. symfony cc

Customizing CkEditor settings

With FCKEditor all custom settings went in fckextraconfig.js. With CKEditor, you can just override settings directly in app.yml.

Toolbars are overridden like this:

a:
  ckEditor_toolbars:
    Default:
      - ['Format']
      - ['Bold','Italic']
      - ['Outdent','Indent','Blockquote']
      - ['OrderedList','UnorderedList']
      - ['-','Link','Unlink','Anchor','-','Table']
      - ['FitWindow','Source']
    Main:
      - ['Format']
      - ['Bold','Italic']
      - ['Outdent','Indent','Blockquote']
      - ['OrderedList','UnorderedList']
      - ['-','Link','Unlink','Anchor','-','Table']
      - ['FitWindow','Source']
    Sidebar:
      - ['Format']
      - ['Bold','Italic']
      - ['Outdent','Indent','Blockquote']
      - ['OrderedList','UnorderedList']
      - ['Link','Unlink','Anchor']
      - ['Table']
      - ['FitWindow','Source']
    Media: 
      - ['Bold','Italic']
      - ['Outdent','Indent','Blockquote']
      - ['Link','Unlink','Anchor']
      - ['Source']

You can also set the default skin, the user interface color, and the list of tags permitted on the format menu. The adefault skin is the Kama skin with the margins fixed to work properly. Standard CKEditor skins are also available. These settings match our defaults:

all:
  a:
    ckEditor_skin: adefault
    ckEditor_uicolor: #e1e1e1
    ckEditor_format_tags: 'p;h3;h4;h5;h6;pre'

You can override all other CKEditor settings by setting app_a_ckEditor_config. See the  CKEditor configuration reference. In addition to what is documented there, we have patched our copy of CKEditor to support the table_defaultWidth and table_defaultWidthUnits settings. We also modified the usual CKEditor default (500 pixels, too wide for some columns) to match the default for the old FCKEditor to minimize confusion (200 pixels). But you can override that to be 100% if you don't have margins on your tables:

all:
  a:
    ckEditor_config:
      table_defaultWidth: 100
      # pixels or percents
      table_defaultWidthUnit: percents

Note that you currently must use the separate options for toolbars, etc. Use ckEditor_config for options that are not available otherwise.

Boom!

Boom! ckeditor replaces fckeditor in rich text slots. And everywhere else in Apostrophe.

Feedback and patches are welcome. Please raise issues (and throw roses) in the  apostrophenow Google Group and via  trac.

- The P'unk Avenue crew