Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 78 additions & 8 deletions docs/add-ons/rte.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,23 @@ Initially RTE installs 4 tool sets:
- Select the tools you wish to have in this tool set.
- Click **Save Tool Set** to save your changes.

### Cloning a Tool Set
[TOC=3]

- Click a tool set's clone icon to create copy of tool set and open it for editing
- Modify the tool set's name.
- Select the tools you wish to have in this tool set.
- Click **Save Tool Set** to save your changes.
### Toolbar elements

#### Editor Type

### Deleting a Tool Set
Rich Text Editor comes with [CKEditor](https://ckeditor.com/) v5 and [Redactor](https://imperavi.com/redactor/) v3 support. Both are great, pick the one that fits your needs best.

To delete a tool set, check the tool set's checkbox in the tool set table listing. Once one or more tool sets are selected, the bulk action control will appear below the table where you can perform bulk actions on the tool sets. Click the drop down to choose delete and then click Submit.
#### Upload Directory

### Toolbar elements
The file management features in RTE field can be allowed to access all upload directories (default) or limited to certain one.

#### Text direction

Choose between "Left to right" and "Right to left"

#### Tool Set Buttons

The following are the buttons that can be enabled in tool set to manipulate the data within an RTE field.

Expand Down Expand Up @@ -91,9 +95,75 @@ The following are the buttons that can be enabled in tool set to manipulate the
- Font color / background
- Fullscreen (Redactor only)

#### Custom Stylesheet
CSS template with styles to be applied to fields using this tool set. All styles will be automatically prefixed with toolset class, which means that the template should hold rather generic styles for the elements.

#### Minimal height

The minimal height for the field in pixels

#### Maximal height

The maximum height for the field in pixels (Redactor only).

#### Limit characters

Limits the number of character that can be entered into the field (Redactor only).

#### Advanced configuration

Toggling this button hides the visual constructor for toolbar and enables editing the configuration directly in JSON format.

#### Configuration JSON

Allows overriding visually constructed tool set with [JSON](https://www.json.org/) object. Please be careful with using this feature and check your work. Remember that all properties need to be quoted.

Initially the field is loaded with the saved configuration of tool set being edited.

Consult [Redactor Docs](https://imperavi.com/redactor/docs/settings/) or [CKEDitor Docs](https://ckeditor.com/docs/ckeditor5/latest/installation/getting-started/configuration.html) for the list of properties. Note that not all features might be supported by ExpressionEngine implementation.

#### Extra JavaScript
JavaScript template to be included with fields using this tool set. Typically used to include extra plugins when using advanced configuration with Redactor.

### Cloning a Tool Set

- Click a tool set's clone icon to create copy of tool set and open it for editing
- Modify the tool set's name.
- Select the tools you wish to have in this tool set.
- Click **Save Tool Set** to save your changes.


### Deleting a Tool Set

To delete a tool set, check the tool set's checkbox in the tool set table listing. Once one or more tool sets are selected, the bulk action control will appear below the table where you can perform bulk actions on the tool sets. Click the drop down to choose delete and then click Submit.

## RTE Configuration

- **Default RTE tool set** - select the tool set that will be selected by default when creating a field.
- **File Browser** - select file browser that will be used when browsing for images and files from RTE fields. ExpressionEngine's FilePicker is used by default, third-party add-ons can provide their own filepickers

NOTE: **Note:** If using the [Multiple Site Manager](msm/overview.md), this preference is per-site.

## Custom plugins

### Redactor

When using Redactor, the javascript for the plugin can be placed in the template, which then needs to be selected in "Extra JavaScript" field for the tool set.
Then enable extended configuration, add the plugin name to list of plugins and provide plugin config if necessary.
If the plugin needs extra styling, it can be placed in CSS Templates selected in "Custom Stylesheet" field for the tool set. If the CSS is targeting buttons, the selectors need to be prefixed with `.redactor-toolbar`.

### CKEditor

Because ExpressionEngine is using custom build of CKEditor, you would need to recompile the editor if you need to add third-party or your own plugin.

If the plugin needs extra styling, it can be placed in CSS Templates selected in "Custom Stylesheet" field for the tool set. If the CSS is targeting buttons, the selectors need to be prefixed with `.ck-toolbar`.

NOTE: **Warning** Doing this requires advanced development skills.

In order to create custom CKEditor build:
- Clone [GitHub repo](https://github.com/ExpressionEngine/ExpressionEngine/)
- Install NPM packages by runnin `npm install`
- Follow the installation instructions for the plugin itself
- Make your changes to `js-src\ckeditor5-build-classic\src\ckeditor.js` and other files as necessary.
- Run the command `npm run build:ckeditor`
- Copy the files from `themes/ee/asset/javascript/src/fields/rte/ckeditor` to same folder on your EE installation
2 changes: 2 additions & 0 deletions docs/fieldtypes/rte.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ When creating or modifying RTE field, the following field settings are available
- **Defer Editor initialization?** - turning this on will initialize the field's editing feature only when it will be focused
- **Column type in database** - database column type to hold your data. TEXT (64Kb) is usually good for an article. If your field content is rather a book, select MEDIUMTEXT (16Mb)

Other settings for the field, such as text direction, allowed upload directories, additional content styling, are being managed in Tool Set setting. Use `Edit Configurations` link to to visit the RTE add-on settings where those can be changed.

## Field features

### @-mentions
Expand Down