Component Title | Rich Text Component |
Description | The RTE provides content authors with a wide range of functionality for editing their text content. |
Features |
|
Location | /apps/ehi-core/aem65/components/content/richtext/v1/rich-text- |
sling:resourceSuperType | core/wcm/components/text/v2/text |
Supported AEM Versions | 6.5 |
Editing Mode | inPlaceEdit |
Component Group | Cheerios Experience |
Use Object | The Rich Text Component component uses the com.adobe.cq.wcm.core.components.models.Text Sling model as its Use-object. |
Extending the components can be done in multiple ways depending on the needs of the brand component.
Use this approach if you do not have any required html markup changes or backend java changes. This will only update the title of the component, componentGroup and point to the resourceSuperType. Optionally can extend the description.
Use this approach if you need to update css classes or add data attributes and do not need to change the backend model, or potentially want to use a different model by retain all of the markup in the component-tmpl.html (Component Template) markup.
The component template is usually named component-tmpl.html this file contains the html markup. Update this file if you need to change the html structure of the component.
Use this approach if you need to change the Sling Model to update the backend logic.
Files that will need to be added when extending:
It is possible to extend more than just the component.html file, if necessary any file that is resourceSupertyped can be extend for example if something needs added to the dialog.
This gives us the flexibility to change our classes or add attributes easily. Say I want to add new javascript I can easily target a different data attribute to trigger my javascript.
RTE functionalities are made available via a series of plug-ins, each with features property. You can configure the features property to enable or disable, one or more RTE features.
Administrators can control the RTE options using content policies, say instead of doing the configuration as described above. Content policies define the design properties of a component when used as part of an editable template . For example, if a text component that uses the RTE is used with an editable template, the content policy can define that the bold option be available and a few paragraph formatting options be available. Content policies are reusable and can be applied across multiple templates.
The available options in the RTE flow downstream from the user interface configurations to the content policies.
The Core Components text component allows template editors to configure many RTE plugins in a GUI as content policies, eliminating the need for technical configuration. Content policies can work with RTE UI configurations as described in this document.
For more information, see the RTE UI settings and content polices section of this document as well as Creating Page Templates and the Core Components developer documentation .
For reference purposes, the default Text components (delivered as part of a standard installation) can be found at:
/libs/wcm/foundation/components/text
/libs/foundation/components/text
To create your own text component, copy the above component instead of editing these components.
The following properties are written to JCR for this Title component and are expected to be available as Resource properties:
Rich Text provides a variety of styles and formatting.
Right
Center
- jcr:primaryType: nt:unstructured
- jcr:createdBy: E524Z2
- jcr:lastModifiedBy: E524Z2
- jcr:created:
- text: <p>Rich Text provides a variety of styles and formatting.</p> <h1>Heading</h1> <p style="text-align: right;">Right</p> <p style="text-align: center;">Center</p> <ul> <li>Bullets©</li> <li>bullet</li> </ul> <ol> <li>Number</li> <li>Number</li> <li> </li> </ol>
- jcr:lastModified:
- sling:resourceType: ehi-core/aem65/components/content/richtext/v1/richtext
- textIsRich: true
Rich Text provides a variety of styles and formatting.
Heading
Right
Center
- Bullets©
- bullet
- Number
- Number
-