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.
SOLVED

AEM 6.1 - pathbrowser - how to pick static files

Avatar

Level 2

pathbrowser works when I point it to DAM location but I don't see static css files under "etc/designs" folders. What should I do to enable static files with "pathbrowser" ?

 

<view 

        jcr:primaryType="nt:unstructured"
        sling:resourceType="granite/ui/components/foundation/form/pathbrowser"
        rootPath="/etc/designs/alpha/css"
        name="./css"
        fieldLabel="CSS File"/> 

 

Thanks

1 Accepted Solution

Avatar

Correct answer by
Level 2

Thanks Amit for pointing me to right direction. I just added predicate="hierarchy" to the field:

<ccfile jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/foundation/form/pathbrowser" rootPath="/etc/designs/alpha/css" predicate="hierarchy" name="./cssfile" fieldLabel="CSS File"/> 

View solution in original post

2 Replies

Avatar

Level 10

You have to override the OOTB component i.e. /libs/granite/ui/components/foundation/form/pathbrowser

This is designed to get everything but files, in this component predicate is built only for hierarchyNotFile.

i.e.  String predicate = cfg.get("predicate", "hierarchyNotFile"); // 'folder', 'hierarchy', 'hierarchyNotFile' or 'nosystem'

override this and modify the jsp to get the desired results.

Avatar

Correct answer by
Level 2

Thanks Amit for pointing me to right direction. I just added predicate="hierarchy" to the field:

<ccfile jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/foundation/form/pathbrowser" rootPath="/etc/designs/alpha/css" predicate="hierarchy" name="./cssfile" fieldLabel="CSS File"/>