Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

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

0 Replies

Avatar

Community Advisor

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"/>