Include WYMEditor (http://www.wymeditor.org/). More...


class   WYMEditor
  Component to include WYMEditor on your page. More...
class   WYMEditorConfig
  WYMEditor config. More...

Detailed Description

Include WYMEditor (http://www.wymeditor.org/).


On install, the module copies wymeditor files to the a folder named "js/wymeditor" below web root. The version of WYMEditor installed is 0.5, but tidy and fullscreen plugin are taken from trunk.

See also:

WYMEditor files are not included by default. To enable WYMEditor on a page, place the following code


This will turn all textareas with class "rte" into a WYMEditor instance.

It is good practice to use "rte" as classname for rich text editors.

Creating Configurations

If the default configuration is not sufficent, you may create your own. This is a two step process:

  • Create and name a config
  • Refer to it by name when enabling editor

First, create a config:

 $config WYMEditor::create_config('fancy');
 $config->init_file = 'js/fancy_wym.js'; // JS script to fire up editor
 // Add tidy plugin
 $config->plugins['js/wymeditor/plugins/tidy/jquery.wymeditor.tidy.js'] = 'var wymtidy = wym.tidy();wymtidy.init();';

You now can use the config anywhere:

 WYMEditor::enable($page_data, 'fancy);

Note you don't need to change the init file, if you add or remove plugins.

Additional notes

WYMEditor is released under GPL and MIT license.