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>