Highlighted

Pathfield search not working properly on AEM 6.3

davidt30874028

02-11-2017

Hi community,

I'm currently working on a site implementation with AEM 6.3. We have a dialog that is using granite/ui/components/coral/foundation/form/pathfield, this is how the code looks like:

<multifieldcollection

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

fieldDescription="Click + to add a new page/asset"

fieldLabel="Add new Page/Asset for static entries"

jcr:primaryType="nt:unstructured"

composite="{Boolean}true">

<field

sling:resourceType="granite/ui/components/coral/foundation/container"

jcr:primaryType="nt:unstructured"

name="./staticPathsConfig">

<items jcr:primaryType="nt:unstructured">

<linkurl

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

fieldLabel="Page/Asset Path"

jcr:primaryType="nt:unstructured"

                                             filter="nosystem,hierarchyNotFile"

rootPath="/content"

name="./path" />

</items>

</field>

</multifieldcollection>

When the user tries to use the search for the pathfield, seems like on the results is showing jcr and metadata nodes which is not correct for an author user. We are expecting to see only pages and assets as a results of the search:

Screenshot 2017-11-02 12.57.44.png

Are we missing something here or this is how the widget is supposed to work? If that the case how can we configured it to only display assets and pages?

Thanks,

David.

Replies

Highlighted

mjb54261515

02-11-2017

Can you pls remove filter and try. something like this 

<linkurl

   jcr:primaryType="nt:unstructured"

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

   fieldLabel="Link Url"

   name="./path"

   rootPath="/content"

   suffix=".html"/>

remove suffix if not needed.

reference:

PathField — Granite UI 1.0 documentation

https://techrevel.blog/tag/multifield/

Highlighted

davidt30874028

02-11-2017

I tried that before, but it was producing the same behaviour. Filter does not make any difference on how the search is working for pathfield. You can check the code if you want.

Highlighted

mjb54261515

02-11-2017

I tested for 6.3 button component with following snippet path filed in it  

               <linkTo

                        jcr:primaryType="nt:unstructured"

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

                        fieldLabel="Link to"

                        name="./linkTo"

                        rootPath="/content"

                        suffix=".html"/>

regular select path works fine but whe we search for a title its showing jcr:content in results too

1339735_pastedImage_2.png

smacdonald2008​ pls look into this

Highlighted

davidt30874028

02-11-2017

Exactly, that's what I mean. I think search is now working correct on the Pathfield, you should be able to find only pages or assets as an author user (not child nodes as jcr or metadata nodes).

Highlighted

smacdonald2008

02-11-2017

I just tested on AEM 6.3 - i get:

APAthField.png

The value is persisted in the dialog --

APAthField2.png

If you use this in your project - you will not have any issues - granite/ui/components/foundation/form/pathbrowser