Expand my Community achievements bar.

AEM6.3 coral touch ui building custom predicate for Pathbrowser or pathfield

Avatar

Level 8

Hi ,

On touch ui dialog ,I am using pathbrowser with predicate as "nosystem"  this shows all the sub-nodes available on the page components. But the issue I have is,it shows the sub-nodes of the components available on the page also ,which we don't need.

We would want to restrict the node level  only to nodes below par to "/content/page/jcr:content/par/..."  .

<reference

                                        jcr:primaryType="nt:unstructured"

                                        sling:resourceType="granite/ui/components/coral/foundation/form/pathbrowser"

                                        fieldLabel="Reference"

                                        margin="{Boolean}true"

                                        name="./path"

                                        predicate="nosystem"

                                        rootPath="/content"/>

Please let me know how this could be achieved.  I saw few examples as https://stackoverflow.com/questions/41677562/how-to-filter-the-pages-visible-in-an-aem-granite-ui-pa...

But i would  want a full sample code of AbstractNodePredicate  which i could use and change. Please help

Thanks

1 Reply

Avatar

Level 8

I noticed that for pathfield it is mentioned with property as filter. So in that case i need to write custom filter ,could some provide  sample code will be helpful.

<reference

                                        jcr:primaryType="nt:unstructured"

                                        sling:resourceType="granite/ui/components/coral/foundation/form/pathfield"

                                        fieldLabel="Reference"

                                        margin="{Boolean}true"

                                        name="./path"

                                        filter="nosystem"

                                        rootPath="/content"/>