Multiple File Upload Panel on Same Page?

Hi… Is it possible to have multiple file upload on panel? if so, how to load it? I want to create separate image collection for each section so user don’t need to select each image. here is the idea:

Panel A content:

Panel B content:

Thank You

Yes, you cab create multiple files sections that each use an individual template.

Hi Texnine, thank You for Your help.

I create this blue print but it show the same file? where did I do wrong?

    type: files
    headline: Main Image       
    type: files
    headline: Gallery 


and how to load it on snippet?

Thank You

First, you have to specify a template for each section, see the docs I linked above. That will make sure each image gets a template assigned in the file. In the absence of such a template, you can’t filter them.

Then in your template/snippet, you can filter by that template:

$galleryImage = $page->images()->template('gallery');

oh okay Okay. Ill try that first. Thank You for Your help.

Thank You Its solved now… Hope You have a nice day…

1 Like

Hi - thanks for this answer - I’m trying to achieve something similar but am running into a couple of issues. First - there doesn’t seem to be a way for the user to see images that were uploaded to a page prior, so if they happen to upload something with the same name, they get the following error (without a way to remove the existing file from with in the panel):

Second, I’m getting an error when trying to access these images from the front end, just using the sample provided:

My blueprint looks like this:

Any ideas of how to solve either of these? Thanks so much!

Could you please provide details about the error?

I don’t understand why the user doesn’t see the images, after all, they show in the files section and can be deleted via the context menu?

Which Kirby 3 version are you using?

Apologies, I believe I was only getting the error if no images were selected, seems to work so long as there are images attached to each gallery.

In the panel I’m seeing the two galleries:

…but there are additional images attached to the page that can’t be seen here – here’s a few of that folder in the finder:

…so if I try to upload a file called “spreads4.jpg”, for example, I get the error shown in my last post.

I’m using Kirby 3.6.0.

Thanks again!

The reason why those files don’t show up in the Panel is probably because they don’t have a template attached to them, or a template that is not used by any of your files sections. So you either have to update the meta data files or re-upload those files after first deleting them, so that the template gets assigned correctly.

That worked - thank you!!