Page 1 of 1

FilePicker preview image?

Posted: Thu Apr 18, 2024 12:06 pm
by 10010110
Is there a way to show a preview image in the filepicker block like JMFilePicker (or GBFilePicker before that) used to do?

Re: FilePicker preview image?

Posted: Thu Apr 18, 2024 1:30 pm
by DIGI3
It does by default, but only if it has a thumbnail file (usually generated if uploaded via filepicker or file manager). If you uploaded it through your OS, for example, you'll need to trigger the generation one at a time in File Picker (I'm hoping for a bulk solution at some point).

Re: FilePicker preview image?

Posted: Thu Apr 18, 2024 1:39 pm
by 10010110
Thanks. I hope we’re not misunderstanding us here. What I mean is in the page edit screen, I want a preview image shown in addition to the text field that shows the file name.
Also, I don’t see a way to trigger the generation of a thumbnail file in FilePicker.

Re: FilePicker preview image?

Posted: Thu Apr 18, 2024 1:46 pm
by DIGI3
I'm not entirely sure what you want, maybe a screenshot would help?

The thumbnail generation is in File Manager, not File Picker.

Re: FilePicker preview image?

Posted: Thu Apr 18, 2024 3:51 pm
by 10010110
I mean this type of input:

Code: Select all

{content_module assign='hero_image' label='Hero image' block='filepicker_block' module='FilePicker' type='image' profile="Standard" scope="global"}
This shows up in the page edit screen in admin as input field where I can select an image. After selecting the image, the file path is shown in the input. I’d like to have the image itself shown there, too.

Re: FilePicker preview image?

Posted: Thu Apr 18, 2024 3:54 pm
by DIGI3
Ah, gotcha. I don't think that would be possible without creating your own admin template. You might want to look at ECB2 though, it has a file_picker field that includes a thumbnail, among many other options that greatly expand the default fields available.

Re: FilePicker preview image?

Posted: Thu Apr 18, 2024 4:59 pm
by 10010110
Thanks, ECB2 looks very useful and exactly like what I need.
But (and this shifts the subject a bit but hopefully can be answered quickly) if I add type='image' to the content module tag it reverts to a standard text input. Am I missing something?

Re: FilePicker preview image?

Posted: Thu Apr 18, 2024 5:04 pm
by DIGI3
This is with ECB2 installed? I haven't run into that, but make sure you're adding all of the required parameters e.g.

Code: Select all

{content_module module=ECB2 field=file_picker block=test type=image}
If you can recreate it then you should file a bug report on the module's forge page, Chris is usually pretty quick to fix things if you can provide steps to reproduce.

Re: FilePicker preview image?

Posted: Wed Apr 24, 2024 2:12 pm
by pierrepercee
DIGI3 wrote: Thu Apr 18, 2024 1:30 pm I'm hoping for a bulk solution at some point
Hello Digi 3,

I think many of us have been waiting for this little improvement for a long time.

As the latest version of CMSMS is a bit late, perhaps it would be time to talk about it?
Note the generation of thumbnails can consume a lot of resources on the server side if the photos are large, you should proceed by calculating the size in MB of the images to be processed then divide into small series to start the generation so as not to load too much the server.