AEM 6.1 - pathbrowser - how to pick static files | Community
Skip to main content
wisemage_
Level 2
February 10, 2016
Solved

AEM 6.1 - pathbrowser - how to pick static files

  • February 10, 2016
  • 2 replies
  • 3427 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by wisemage_

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

2 replies

Amit_Kumar
Level 10
February 10, 2016

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.

wisemage_
wisemage_AuthorAccepted solution
Level 2
February 11, 2016

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