XHTML Editor JSON Configuration
For XHTML editor elements, configure JSON overrides as needed in the Edit JSON Config Overrides editor interface. You can choose to apply these overrides either as default settings for all users or for individual user groups.
Next Steps: Verify your JSON override settings are functioning correctly by opening a Site Tree content item with an XHTML editor and testing the overrides. If the overrides are configured for individual groups, you may need to have a user with the appropriate permissions test them.
For example, to verify the JSON override example #1 configurations, select in the XHTML editor. Your custom formats will display in this list, which you configured in the Edit JSON Config Overrides editor.
JSON Override Examples
The following overview provides code examples you can use in the Edit JSON Config Overrides editor.
For complete descriptions of JavaScript override options and JavaScript sample code, refer to the TinyMCE Documentation.
Example #1
Options
valid_children
- Controls which child elements can reside within specified parent
elements.
Control characters:
- Plus Sign (
+
) - Adds children to the list of valid elements for the specified parent.
- Minus Sign (
-
) - Removes children from the list of valid children for the specified parent.
- Plus Sign (
The above code sample demonstrates how to add style as a valid child of the
<body>
tag and add<div>
,<a>
, and<p>
tags as a valid child of the<a>
tag.importcss_selector_filter
- Enables only import classes from selectors matching the filter. The filter can be a string, regular expression (RegExp), or function.
style_formats_merge
- Determines if TinyMCE appends the styles in the
style_formats
setting to the default style formats or completely replaces them. The default value isfalse
. style_formats
- Adds advanced style formats for text and other elements to the editor.
The value of this option renders as styles in the
Formats drop-down menu.
For examples of options within
style_formats
, see TinyMCE Style Formats.
Result
Example #2
Options
valid_children
- Controls which child elements can reside within specified parent elements.
style_formats_merge
- Determines if TinyMCE appends the styles in the
style_formats_merge
setting to the default style formats or completely replaces them. The default value isfalse
. style_formats
- Adds advanced style formats for text and other elements to the editor.
The value of this option renders as styles in the
Formats drop-down menu.
For examples of options within
style_formats
, see TinyMCE Style Formats.