Expand my Community achievements bar.

Applications for the 2024-2025 Adobe Experience Manager Champion Program are open!
SOLVED

AEM SPA React - specific Component Authoring dialog clientlib

Avatar

Level 3

Is it possible to add clientlib to target 1 components authoring dialog?

I have a component that when using the pathbrowser to load data, would grey out all other dialog fields. 

goonmaniangooner_0-1663277955881.png

goonmaniangooner_1-1663277983121.png

I would like to grey out options in General, Padding, Margin tabs and maybe have a disclaimer saying Content frament is in use? As the content fragment json loaded from the pathbrowser is overriding the values. Is this possible? I only want to affect this specific RTE Component. and nothing else. 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@goonmanian-gooner  You can use “extraClientlibs” property on the dialog to load a clientlibs applicable only for it. You can add your custom logic in this clientlibs.There are few things that you need to take care of when using extraClientlibs :

1. DO not include every custom JS client library into the cq.authoring.dialog category
2. Every component dialog with custom JS code have to be placed in a separate category, easy to use package or folder path as a category name, this prevents category name overlap
3. Make a rule to put validation that we are working with the required dialog at the JS beginning, if not – bypass the execution

Link : https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/aem-dialog-with-extraclien...

 

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

@goonmanian-gooner  You can use “extraClientlibs” property on the dialog to load a clientlibs applicable only for it. You can add your custom logic in this clientlibs.There are few things that you need to take care of when using extraClientlibs :

1. DO not include every custom JS client library into the cq.authoring.dialog category
2. Every component dialog with custom JS code have to be placed in a separate category, easy to use package or folder path as a category name, this prevents category name overlap
3. Make a rule to put validation that we are working with the required dialog at the JS beginning, if not – bypass the execution

Link : https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/aem-dialog-with-extraclien...