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

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

Avatar

Level 2

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 2

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.