Multiple image selector form helper

Permalink
Has anyone built a multiple image selector form helper? Just like the helper that comes with Concrete for selecting single files/images, but allows you to select multiple images?

I'm building a package where I need to allow the user to associate multiple photos with a venue. So I have a venue "add/edit" form with all of the details of the venue, and I want the user to be able to select multiple photos in the regular assets dialog and show them on the form. I was hoping someone might have come across this already...

blakeage
 
jordanlev replied on at Permalink Reply
jordanlev
Check out how the built-in "slideshow" block works. It's not intuitive at first, but if you set it to "Custom Slideshow" (as opposed to "File Set"), and then click the "Add Image" button, you can actually choose multiple images from the file manager by checking the boxes next to the ones you want and then selecting "choose" from the little "**" dropdown menu at the top of the list. They will all be added to the slideshow edit dialog then.

To make this work you need to have a javascript function that serves as a callback for the file manager, which will pass all of the selected file id's to you, and then it's up to you to populate your editing interface with those selections and save them to the database (you'll need an additional table to store those records in for your block, which will have a many-to-one relationship with the block's primary table).

Look at the slideshow block's code to see how this works (the callback handler will be in auto.js). It's pretty messy, though -- I can probably dig up some cleaner code somewhere for this if you're interested.

-Jordan
blakeage replied on at Permalink Reply
blakeage
Thanks, I will check that out