Skip to content

Instantly share code, notes, and snippets.

@mattlo
Last active July 6, 2023 07:44
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattlo/d9f699e8142e00df99747772f3a486ba to your computer and use it in GitHub Desktop.
Save mattlo/d9f699e8142e00df99747772f3a486ba to your computer and use it in GitHub Desktop.
AEM 6.2 Touch UI Rich Text Editor Inline Dialog; Coral UI, RTE, CQ5, CUI, RichText

Example config for RTE within a Dialog

  • rtePlugins enables the CUI registry (cq/ui/rte/core/plugins/PluginRegistry.js)
    • Some plugins are enabled be default, so there's instances online where this section is omitted. You'll need this configuration if you want anything that isn't default. I left some other plugin configurations here that aren't in use.
  • uiSettings is a configuration used by CUI
    • Some online resources will note other cui children. inline is the configuration plugin for the inline toolbar mode. fullscreen is the configuration plugin for the full screen toolbar mode. If a plugin isn't enabled, some settings here won't activate.
  • Fixed inline mode won't work for 6.0 or 6.1. You'll need 6.2. In 6.3+, this may not work due to CUI2 being introduced. CUI2 may simplify some setup.

table

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0"
xmlns:cq="http://www.day.com/jcr/cq/1.0"
xmlns:jcr="http://www.jcp.org/jcr/1.0"
xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="nt:unstructured">
<content jcr:primaryType="nt:unstructured">
<items jcr:primaryType="nt:unstructured">
<tabs jcr:primaryType="nt:unstructured">
<items
jcr:primaryType="nt:unstructured">
<dialog-poc
jcr:primaryType="nt:unstructured"
jcr:title="Dialog POC"
sling:orderBefore="basic"
sling:resourceType="granite/ui/components/foundation/section">
<layout
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/layouts/fixedcolumns"
margin="{Boolean}false"/>
<items jcr:primaryType="nt:unstructured">
<column
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/container">
<items jcr:primaryType="nt:unstructured">
<text
jcr:primaryType="nt:unstructured"
sling:resourceType="/libs/cq/gui/components/authoring/dialog/richtext"
fieldLabel="Rich Text Editor Example"
name="./text"
useFixedInlineToolbar="{Boolean}true">
<rtePlugins jcr:primaryType="nt:unstructured">
<format
jcr:primaryType="nt:unstructured"
features="*"/>
<justify
jcr:primaryType="nt:unstructured"
features="*"/>
<lists
jcr:primaryType="nt:unstructured"
features="*"/>
<paraformat
jcr:primaryType="nt:unstructured"
features="*"/>
<links
jcr:primaryType="nt:unstructured"
features="*"/>
<table
jcr:primaryType="nt:unstructured"
features="*" />
<subsuperscript
jcr:primaryType="nt:unstructured"
features="*"/>
<misctools
jcr:primaryType="nt:unstructured"
features="*"/>
</rtePlugins>
<uiSettings jcr:primaryType="nt:unstructured">
<cui jcr:primaryType="nt:unstructured">
<inline
jcr:primaryType="nt:unstructured"
toolbar="[table#createoredit,links#modifylink,links#unlink,format#bold,format#italic,justify#justifyleft,justify#justifycenter,justify#justifyright,lists#unordered,lists#ordered,lists#outdent,lists#indent,fullscreen#start,control#close,control#save]"/>
</cui>
</uiSettings>
</text>
</items>
</column>
</items>
</dialog-poc>
</items>
</tabs>
</items>
</content>
</jcr:root>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment