CKEditor SDK

Advanced Content Filter – Custom ModeDocumentation

Advanced Content Filter (ACF) can work in automatic mode, can be disabled, and can work in custom mode.

Custom mode requires the developer to provide all tags, attributes, classes and styles through the config.allowedContent setting. The provided configuration affects not only the HTML content that CKEditor will accept, but also influences the features (plugins, buttons, dialog window fields) that will be available to the end user.

Automatic ACF Mode

In the sample below CKEditor works in automatic ACF mode (default behavior, requires no configuration).

Custom ACF Mode

In the sample below, the same editor is used, but config.allowedContent is manually set to:

h1 h2 h3 p blockquote strong em del ins table tr th td caption;

Note how the lack of <ul>, <ol>, <li>, <hr> elements on the list affected the editor configuration: Numbered List, Bulleted List and Horizontal Rule buttons are missing. Another change is that the Table, Link or Image dialog windows have a smaller number of options, as the custom configuration did not allow as many attributes or styles as CKEditor does by default.

The meaning of each rule is explained below:

Any tags not present on this list will be discarded (like the list items which were removed in the sample above). By default, attributes, styles and classes are rejected for each specified tag and must be enabled manually (background-color was not set as allowed for <td> tag so it was removed).

Related Features