2
votes

in classic ui, you can use xtype:cqinclude to include rtePlugins from a different path basically creating one place for standard RTE plugins, How can I do the same in Touch UI?

I have tried using the granite UI include widget, but that does not help as it was not meant for including nodes, but granite widgets/components

2

2 Answers

3
votes

I found the solution by debugging RTE, I noticed that RTE sends a request to get the rtePlugins (as JSON) from JCR (using the JSON servlet). with that understanding, I was able to use sling:superResourceType on the rtePlugins node to refer to another rtePlugins node on the JCR. since the JSON servlet will actually respect the superType relationship. Read more abour Sling Resource Merger here: https://docs.adobe.com/docs/en/aem/6-1/develop/platform/sling-resource-merger.html

eg. if I define rtePlugins node under apps/project/customeRtePlugins/rtePlugins, then in my actual RTE in my touch dialog, I can do the following:

<rte
    jcr:primaryType="nt:unstructured"
    sling:resourceType="cq/gui/components/authoring/dialog/richtext"                                                                
    name="./rte"
    useFixedInlineToolbar="{Boolean}true">

    <rtePlugins 
         jcr:primaryType="nt:unstructured"
         sling:resourceSuperType="apps/project/customeRtePlugins/rtePlugins"/>

</rte>
2
votes

I think the process is a little bit unique for RTE in the TouchUI. You will probably need to create an overlay of the Text component including a _cq_editConfig.xml This will have a configPath property pointing to the ClassicUI dialog as you can see in the example below. In the ClassicUI dialog.xml for the RTE, the element referenced in the configPath has the name attribute and also contains the element (rtePlugins) which contains all the RTE Plugin configurations

<cq:inplaceEditing jcr:primaryType="cq:InplaceEditingConfig" 
editorType="text" active="true" configPath="/apps/wcm/foundation/components/text/dialog/items/tab1/items/text"/>