Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.

How to add multiple rootPath in Coral 3 Pathfield

Avatar

Level 2

How to add multiple rootPath in Coral 3 Pathfield ? It currently allows only one rootPath. I need 2 or 3 different rootPath to be shown for selection.

5 Replies

Avatar

Level 2

Yes, it only supports a String ie. only one rootPath. But is there any way I can override this and allow multiple rootPaths to be used with pathField component ?

Avatar

Community Advisor

You will need to overlay/extend this component...

- Overlay /libs/granite/ui/components/coral/foundation/picker/picker.jsp to accept multifield.

- Overlay /libs/granite/ui/components/coral/foundation/picker/picker.jsp to check for multiple root paths instead of single, in method "getCrumbs".

Avatar

Level 2

Hi Vivek,

Can you share that jsp with me
Email:- ssiddhartha28@gmail.com

Thanks,

Siddhartha

Avatar

Community Advisor

FYI, Not a good idea from 6.4 onward because picker is marked as granite:FinalArea, so you can't overlay.

Though you can take a reference and create your own resourceType from OOTB pathfield in 6.4 e.g. /apps/granite/ui/components/coral/foundation/form/pathfieldmulti

Final (granite:FinalArea) - Defines a node as final. Nodes classified as final cannot be overlaid or inherited. Final nodes can be used directly via sling:resourceType. Subnodes under final node are considered internal by default

Or you can allow root of all the path and put dialog validation, if path is not choose from desired paths dialog wouldn't be submitted.



Arun Patidar