Out of the box, Telligent includes support for two text editors.
- Default Text Editor - Standard text box, with no special features
- TinyMCE - WYSIWYG editor
You can add support for custom text editors by creating a control which implements the CommunityServer.Controls.ITextEditor interface.
Editors are registered in the <editors> section of the <core> node in the communityserver.config file. Each editor is registered as an individual editor node with the following attributes.
- name - Name of the editor.
- type - Type of the implementation of ITextEditor that should be used for the editor.
- resourceName - Name of a resource with a friendly name for the editor.
- default (optional) - Boolean value specifying whether the editor is the default editor. If multiple editors have default set to true, then the first editor with isDefault set to true will be taken as the defalt Editor. If no editors have default set to true, then the first editor is deemed to be the default.
- resourceFile (optional) - Resource file which contains the resource containing the friendly editor's name.
You can have different editor nodes using the same control type. For example you could provide two TinyMCE editors, one with a 'basic' mode which only supports bold, italics and underline, and one with an advanced mode which provides more options.
Each editor node can also have one or more <editorOption> nodes assosiated with it. An EditorOption node has two attributes
- name - Name of the property being configured.
- value - Value of the property being configured.
How these EditorOptions are used is up to the Editor Control. The DefaultTextEditor control ignores these EditorOptions, while the TinyMCE editor uses them to configure TinyMCE Configuration Options.
When modifying or adding editors and editorOptions, you should make your modifications through a communityserver_override.config file. Below are three sample overrides for manipulating editors and editorOptions.
Add an Editor
The following markup adds a new editor.
<Override xpath="/CommunityServer/Core/editors" mode="add">
Add an Editor Option
The following markup puts the standard TinyMCE editor into read only mode:
<editorOption name="readonly" value="1" />
Edit an Editor Option
The following markup disables resizing of the editor.