Is it Possible to set the path selected in searchRoot to be the rootPath of tagSelector | Adobe Higher Education
Skip to main content
New Member
November 27, 2024
Répondu

Is it Possible to set the path selected in searchRoot to be the rootPath of tagSelector

      <items jcr:primaryType="nt:unstructured">
                                            <searchRoot
                                                jcr:primaryType="nt:unstructured"
                                                sling:resourceType="granite/ui/components/coral/foundation/form/pathfield"
                                                fieldDescription=""
                                                fieldLabel="Tag Path"
                                                name="./searchTagsPath"
                                                required="{Boolean}false"
                                                rootPath="/content/cq:tags"
                                                value="${not empty cqDesign.searchRoot ? cqDesign.searchRoot : ''}"/>
                                            <tagSelector
                                                jcr:primaryType="nt:unstructured"
                                                sling:resourceType="cq/gui/components/common/tagspicker"
                                                fieldDescription=""
                                                fieldLabel="Select Tags"
                                                name="./searchTags"
                                                required="{Boolean}false"
                                                rootPath=""
                                                value="${not empty cqDesign.searchRoot ? cqDesign.searchRoot : ''}"/>
                                        </items>
Meilleure réponse par PRATHYUSHA_VP

Hi @vivekna3 

 

Adding my thoughts here -

 

1. One way to achieve this is writing custom script and add the script in extraClientlibs in the dialog. Upon selection of searchRoot update tagSelector rootPath in the script.

2. Other way is changing the searchRoot as a dropdown field and select the pre-defined rootPaths from the list. Based on the selection hide/show the tagSelector rootPath using cq-dialog-show-hide property (No customization is needed in this case)

 

Hope this helps

 

Thanks

 

2 commentaires

PRATHYUSHA_VP
Community Advisor
Community Advisor
November 27, 2024

Hi @vivekna3 

 

Adding my thoughts here -

 

1. One way to achieve this is writing custom script and add the script in extraClientlibs in the dialog. Upon selection of searchRoot update tagSelector rootPath in the script.

2. Other way is changing the searchRoot as a dropdown field and select the pre-defined rootPaths from the list. Based on the selection hide/show the tagSelector rootPath using cq-dialog-show-hide property (No customization is needed in this case)

 

Hope this helps

 

Thanks

 

gkalyan
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
December 1, 2024