apache > lenya
 

The tinymce Module

Introduction

The tinymce module contains the integration of the TinyMCE WYSIWYG editor.

Installation

  1. Download TinyMCE from http://tinymce.moxiecode.com

    Unpack the archive in the resources directory of the tinymce module ($LENYA_HOME/src/modules/tinymce/resources/) to make it globally available,
    or, if you don't want to change stuff in your source tree,
    in your publication under $PUB_HOME/lenya/modules/tinymce/resources/.

    That should give you a subdirectory named tinymce.

  2. Optionally download additional language packs and unpack them in the same place. (The new files will end up in tinymce/ as well.) As of module version 0.5.1, TinyMCE will present itself in the locale that your browser requests, if an appropriate language pack can be found.
  3. Check the file permissions of the new "tinymce" directory. It should not be world-writable for security reasons. On UNIX systems, you can fix that with
    chmod -R og-w tinymce/
  4. Add the appropriate permissions to $PUB_HOME/config/access-control/usecase-policies.xml (or use the usecase administration GUI), for example:

    <usecase id="tinymce.edit">
      <role id="admin" method="grant"/>
      <role id="edit" method="grant"/>
    </usecase>

    This will allow the "admin" and "edit" roles to access the usecases to edit and upload images.

  5. To add a menu entry, in $PUB_HOME/config/publication.xml add
    <module name="tinymce"/>
    next to the other module declarations. This does not work in the default publication, because it creates its own custom menus. But for a quick test, you can append ?lenya.usecase=tinymce.edit to your address-bar URL.

Make sure your site plays well with TinyMCE

You will find that TinyMCE does not look good with certain layout styles. Specifically, floating objects inside or next to your editable area might result in wrecked layout when the editor is active. To achive true WYSIWYG, try to design your page so that editable areas have a fixed size and be careful with floats (you can still have accessible design by using "em" instead of "px").

By default, TinyMCE will parse your CSS stylesheet and make all classes available in its styling dropdown menu. That means you should not introduce classes for one-shot stylings outside the editable area (unless you want to make those stylings available in the content area as well). Use ids instead.

This module has been tested with TinyMCE 2.1.2.