iWE2

iWE2 - imperia's WYSIWYG Editor

has the ckeditor.com as a basis, but has been adapted to imperia CMS.



Invocation#

Invocation from a Template#

In order to use the iWE2, you must place the corresponding processing instruction in a template. In the minimum configuration this looks like the following:

<?imperia iwe2
id: iwe2 ?>

This processing instruction contains the configuration options, which must be included as a minimum in every invocation of the iWE2 in an imperia template. An instance of iWE2 with the standard configuration will be called.

Important

Please make sure that the value of the id option is unique.


Invocation from a Flex Module#

In order to use iWE2 in a flex module, you must make sure that the id of the iWE2 instance is unique. This is done by adding an ID to the flex module in the processing instruction.

Example:

#IF ("<!--XX-editmode-->")
<br />
<?imperia iwe2
id: iwe2_<!--FLEX_INDEX-->_<!--FLEX_ID-->?>
#ELSE
<div> <!--XX-FLEX-iwe2--> </div>
#ENDIF


iWE2 Configuration#

iWE2 offers a variety of configuration options with which you can influence functionality, outlook and behavior.

There are two ways to configure the editor:

  • Configuration in a template

    With this method the configuration of the corresponding editor instance is done via an imperia template.

  • Configuration via a configuration file

    With this method you can either specify a configuration file in an imperia template for every instance in it or use a global file for all instances.

Important

Please consider the hierarchy of the configuration possibilities. When you have placed a configuration option in the template, this, in general, has advance compared to the options set in a configuration file. Therefore, there are three hierarchy levels:

  1. Template
  2. User-defined configuration file of the instance
  3. Global configuration file

If you use different custom configurations for iWE2 instances in one document, the behavior is undefined. If possible, prevent such cases.


Configuration in an imperia template#

Along with the necessary configuration options there are also a number of further possibilities to adjust iWE2. There are also some options, which can only be set in a template, but not in a configuration file. A list of all available configuration options can be found at

Configuration in a template is always done with the following syntax, where “option” is the name of the configuration option and “value” is the corresponding value:

<? imperia iwe2
id: iwe2
Option: value ?>

Configuration in a Configuration File#

Another way to configure an instance, is by using a configuration file. To do so you must set the “customConfig” option within a template. The value of that option should indicate a configuration file with absolute path, relative to the DOCUMENT-ROOT. Example:

<? imperia iwe2
id: iwe2
customConfig:/foo.js ?>

You can place the desired configuration options in the 'foo.js' file.

Important

An important difference for configuring via a configuration file is that the configuration starts with editorConfig function definition and it must contain the config.customConfig = '/imperia/js/components/iwe2/default_config.js' line. Also the option value pair should not be divided by a colon, but with an equal sign. One should also consider the ending semicolon. Example:

CKEDITOR.editorConfig = function( config ) {
      config.customConfig = '/imperia/js/components/iwe2/default_config.js';
      option = 'value';
      };


Events#

The CKEditor offers events that you could use to trigger your own functions. For further information on these events, please refer to CKEditor's documentation.

A specific for imperia event, is the .change() event that is triggered when a user saves an external iWe2 window. Example:

$( "#your_iWE2_id" ).change(function() {
    alert( "Handler for .change() called." );
});