Expand my Community achievements bar.

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

Avatar

Level 1
      <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>
Topics

Topics help categorize Community content and increase your ability to discover relevant content.

2 Replies

Avatar

Level 5

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