Skip to content
INSTALL.txt 4.69 KiB
Newer Older
********************************************************************
                     D R U P A L    M O D U L E
********************************************************************
Name: TinyMCE module
Authors: Matt Westgate <drupal at asitis dot org> and
         Richard Bennett <richard.b@gritechnologies.com>
Dependancies:
  This module requires the third-party TinyMCE editor and a
  Javascript-enabled web browser.  Currently it is known to work
  with Internet Explorer, Mozilla and Firefox and degrade gracefully
  for Safari and Konqueror users. A browser compatibility chart is here:

  http://tinymce.moxiecode.com/wrapper.php?url=tinymce/docs/compatiblity.htm

INSTALLATION:
********************************************************************
1. Place the entire tinymce directory into your Drupal modules/
   directory.

2. Download TinyMCE 1.43 from:

     http://tinymce.moxiecode.com/download.php

   Uncompress the file and make sure it's named 'tinymce'.

3. Place the entire tinymce folder inside your modules/tinymce directory.

4. Enable this module by navigating to:

     administer > modules

4. Optionally, fine tune how this module operates by navigating to:

     administer > settings > tinymce

Create new content and see TinyMCE in action!

README:
********************************************************************
Once TinyMCE is enabled, the default behavior is that all textareas
will use TinyMCE for all users. The admin can change these defaults
at

  administer > settings > tinymce

For example, the default theme TinyMCE will use is called 'simple'.
Themes control the functionality TinyMCE makes visible. It comes
with 3 themes:

  1) Simple - basic formatting
  2) Default - basic formatting with tables
  3) Advanced - many many features. See a demo at
        http://tinymce.moxiecode.com/example_advanced.php?example=true

The admin can choose what theme TinyMCE should be the default and
user's can override this by editing their account. User's also have
the option of disabling TinyMCE completely.

The admin can also define which pages TinyMCE should be used on.
This cannot be changed on a per user basis.

CAVEATS
********************************************************************
By default, Drupal uses the 'Filtered HTML' input format for adding
content to the site and this can create conflicts with TinyMCE. It's
best when using this editor to use an input format that has all
filters disabled. What I usually do is create an input format called
'Rich-text editing' and set that as the default format for roles which
use TinyMCE exclusively. To modify your input formats go to:

    Administer > input formats > configure > configure filters

TWEAKING THE TINYMCE THEME
********************************************************************

Developers have complete control over the arguments which invoke a
TinyMCE theme by creating a custom Drupal theme function.  In your
Drupal theme file create a new function called tinymce_theme:

/**
 * Customize a TinyMCE theme.
 *
 * @param init
 *   An array of settings TinyMCE should invoke a theme. You may override any
 *   of the TinyMCE settings. Details here:
 *
 *    http://tinymce.moxiecode.com/wrapper.php?url=tinymce/docs/using.htm
 *
 * @param textarea_name
 *   The name of the textarea TinyMCE wants to enable.
 *
 * @param theme_name
 *   The default theme name to be enabled for this textarea. The sitewide
 *   default is 'simple', but the user may also override this.
 *
 * @param is_running
 *   A boolean flag that identifies id TinyMCE is currently running for this
 *   request life cycle. If it's already running then anything returned by this
 *   will be ignored. This is necessary since TinyMCE works by being invoked
 *   once per request and not once per textarea.
function tinymce_theme($init, $textarea_name, $theme_name, $is_running) {
  switch ($theme_name) {
    case 'advanced':
      $init['extended_valid_elements'] = 'a[href|target|name]';
      $init['plugins'] = 'table,emotions,iespell, print';
      $init['theme_advanced_buttons3_add_before'] = 'tablecontrols,separator';
      $init['theme_advanced_buttons3_add'] = 'emotions,iespell,separator,print';
      return $init;
  }
The above function would add tables, emotions, spellchecking
(IE only) and a print button to the 'advanced' theme.  There are
many ways this function can be used. For example you could make
comment textareas use the 'simple' theme while node forms use
'advanced' by inspecting the name of the textarea ($textarea_name).

Note that the way you build the theme function depends on the theme
engine you're using.

See the TinyMCE manual for details on the parameters that can be
sent to TinyMCE:

http://tinymce.moxiecode.com/wrapper.php?url=tinymce/docs/index.htm