Unable to reuse RTE and UI settings plugins using sling:resourceType - granite/ui/components/foundation/include

nalla0109

18-08-2020

We have a global dialog which has a a couple of text fields and a RTE which is being referred in multiple components using sling:resourceType - granite/ui/components/foundation/include and path properties. So far it works fine. Now we created the RTE plugins and UI settings as separate nodes and we have referred them within the global dialog for RTE by using sling:resourcesuperType. But it is not picking up the plugins when we edit the component dialogs. Looks like if we use "include" to refer a RTE node which is in turn using slingresourceSuperType to fetch the plugins then it does not seem to work.


Below are the cq dialog xml's:


Component where we have reused the global dialog

<globalTab
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/include"
path="/apps/test/components/base/_globalTab"/>

 _globalTab dialog where we referred the RTE and UI settings plugins

<descriptionText
jcr:primaryType="nt:unstructured"
sling:resourceType="cq/gui/components/authoring/dialog/richtext"
fieldDescription="description text"
fieldLabel="description text"
name="./descriptionText"
removeSingleParagraphContainer="{Boolean}true"
required="false"
useFixedInlineToolbar="{Boolean}true">
<rtePlugins
jcr:primaryType="nt:unstructured"
sling:resourceSuperType="/apps/test/components/base/rtePlugins"/>
<uiSettings
jcr:primaryType="nt:unstructured"
sling:resourceSuperType="/apps/test/components/base/uiSettings"/>

 

RTE sling Touchui dialog

Accepted Solutions (1)

Accepted Solutions (1)

Vijayalakshmi_S

MVP

19-08-2020

Hi @nalla0109,

I could reproduce the issue you have mentioned and could realize that it is expected with the way "include" granite resource works.(/libs/granite/ui/components/coral/foundation/include/include.jsp)

It works like this

  • Gets the resource from the "path" property - usual way of getting resource from path - resourceResolver.getResource(path)
  • Makes use of ComponentHelper.include method which is equivalent to <sling:include resource="".. />

Reference:

https://helpx.adobe.com/experience-manager/6-3/sites/developing/using/reference-materials/javadoc/co...

With this set up, looks like sling:resourceSuperType is not evaluated and I don't think include within include(instead of sling:resourceSuperType) again would work.

Will check if there is any other possible options for your requirement and update this thread.

 

 

Answers (0)