Expand my Community achievements bar.

SOLVED

Is there something like a rootPath behaviour for cq/gui/components/authoring/dialog/fileupload?

Avatar

Level 3

Hello,

 

I have a fileupload field in my dialog which will, when clicked on browse, display selection path that i predifined(wanted behaviour).

The default behaviour is to display everyhting in dam path but i would like to make author only browse from my path like /content/dam/project. I know this is possible with rootPath on some other components. I could use granite/ui/components/coral/foundation/form/pathbrowser for this(with rootPath), but the problem is that pathbrowser doesnt have image preview(thumbnails) next to asset name. Is there any way to achieve this? 

 

Thanks,

Luka

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @luka2, you can use granite/ui/components/coral/foundation/form/pathfield. It should meet all your needs:

  • it shows asset thumbnail
  • it supports rootPath configuration

Here is example of pathfield usage with rootPath set to /content/dam
pathfield.png

Please also be aware that pathbrowser is deprecated and pathfield should be use instead.

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hi @luka2, you can use granite/ui/components/coral/foundation/form/pathfield. It should meet all your needs:

  • it shows asset thumbnail
  • it supports rootPath configuration

Here is example of pathfield usage with rootPath set to /content/dam
pathfield.png

Please also be aware that pathbrowser is deprecated and pathfield should be use instead.

Avatar

Level 3

Hello @lukasz-m 

Thank you for your answer.

The problem with pathfield is that we lose drag and drop functionality as well as search and filter for dam assets.