Pass an array to Image Gallery and Cycler.

Page: 1

Author Post
Member
Registered: Nov 2010
Posts: 71
Is there a method to pass an array to the image gallery or the image and thumbnail cycler for filenames to display instead of using individual html tags? If yes, what are the particulars.

With my current method of displaying a slide show to simplify maintenance, I usually place all photos I want to display in a specific directory. I then use a PHP script to place the filenames in an array and then pass on the array to a javascript program.
Administrator
Registered: Aug 2008
Posts: 3382
No, sorry, the php script will need to write the necessary html elements to the page.

I think the ability to pass an array as the source parameter to the fb.start API function for showing a gallery set would be a desirable enhancement and may well show up in the next release.

Something similar for image cycler sets is not realistic because those cycling images need to be elements on the page when they're cycling, and because of the complexity of the information that would need to be passed in the array. (image source, cycler options, initial height for the cycler div, caption for each image, does this image link to somewhere?, if so, where?, should the link open in floatbox?, if so, what floatbox options should be assigned?)
Member
Registered: Nov 2010
Posts: 71
Thanks for the reply. For the pages with just a few photos I'll write the html elements to the page. For the ones with many photos (100 plus) I'll stay with my old method for the slide show.
Member
Registered: Aug 2011
Posts: 6
I would vote for this enhancement. Modern web practice is to put a lot more app code in the client side (e.g. Angular); much more efficient to pass in an array into fb.start() than to dynamically write a bunch of tags in the HTML.
Administrator
Registered: Aug 2008
Posts: 3382
4.5 years since I agreed this would be a good idea. But...
I didn't actually enter on the todo-list, so it drifted off into the land of shoulda woulda coulda.

It's done and locked in to the code for the upcoming version 7 release (for galleries, not for cyclers, for more-or-less the reasons already given).

Thanks for the reminder.

Page: 1