Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hi @Shwetha1994
Create a Custom Plugin:
AEM's CKEditor allows you to customize the toolbar by adding plugins. To include a font size plugin, you will need to define the plugin in a custom configuration file.
Modify the RTE Configuration:
In your AEM project, locate the cq:dialog for your component, where the RTE is defined. If you're using the default RTE, you'll need to configure it in the dialog’s JSON or JavaScript file.
Add the Font Size Plugin to the Configuration:
You need to add the plugin and configure the toolbar. Here’s an example of how to include the font size plugin in the configuration.
{
"plugins": [
"font",
"fontSize"
],
"toolbar": [
["FontSize"]
]
}
This will add a font size selector to the toolbar. Make sure the font and fontSize plugins are included in the plugins array.
If you're using a dialog to manage the component, ensure that the dialog is properly configured to include the custom RTE settings. You will need to use the RTE configuration in the cq:dialog structure.
Here is an example configuration in an AEM dialog that includes the fontSize plugin:
<dialog xmlns="http://www.w3.org/2001/XMLSchema-instance"
xmlns:sling="http://sling.apache.org/jcr/sling"
jcr:primaryType="cq:Dialog">
<content
jcr:primaryType="cq:Widget"
fieldLabel="Rich Text Editor"
xtype="richtexteditor"
rtePlugins="[font, fontSize]"
toolbar="fontSize"
/>
</dialog>
Ensure the plugin is properly bundled in your AEM deployment package.
Once deployed, clear the browser cache and test the RTE with the font size plugin.
Go to the page where the component with RTE is implemented.
Open the dialog and check if the font size selector appears in the toolbar.
Test the functionality by changing the font size of the text in the editor.
Hope this helpful.
Regards,
Karishma.
To add a font size plugin to the Rich Text Editor (RTE) in Adobe Experience Manager (AEM) as a Cloud Service, you need to customize the Rich Text Editor (RTE) configuration using the Text component’s dialog and cq:inplaceEditing configuration.
Ensure your text component uses the correct rtePlugins configuration.
Path: /apps/<your-project>/components/<your-text-component>/cq:dialog/content/items/<path_to_rte>/rtePlugins
If not present, create it.
fontsize plugin isn't enabled by default. You need to configure it manually as above.
You also need to configure the uiSettings node to expose it in the toolbar.
<uiSettings jcr:primaryType="nt:unstructured"> <toolbar jcr:primaryType="nt:unstructured"> <fullscreen jcr:primaryType="nt:unstructured" items="[undo, redo, bold, italic, underline, fontsize]" /> </toolbar> </uiSettings>
You can customize toolbar items based on your requirements.
You can define the actual font size classes:
These classes (small-text, etc.) must be defined in your clientlibs CSS.
Ensure the font size classes used above are defined in the CSS, e.g.:
This CSS should be part of the clientlib that's included with your component.
Hi @Shwetha1994
Please check here
@Shwetha1994 Just checking in — were you able to resolve your issue?
We’d love to hear how things worked out. If the suggestions above helped, marking a response as correct can guide others with similar questions. And if you found another solution, feel free to share it — your insights could really benefit the community. Thanks again for being part of the conversation!
Views
Replies
Total Likes
Views
Likes
Replies