Populate slideshow with 5 random images from directory
I've been searching for a clean way to get 5 random images from an images folder and use them in a slideshow.
Normally I would just use PHP to access the directory and add the file names to an array and then use JavaScript to randomly add them to the slider, but this doesn't seem to be an option in Wild Apricot.
Is there a reliable work around?
-
Kerrie-Anne commented
There are free tools that will rename all the files for you in a directory to a specific formula as well - if you're set up to use webdav, it would then be really simple to re-upload the renamed files...
-
apaul34208 commented
Thanks for the response, but that's not quite what I'm looking for.
To use the plugin I would have to change all of the file names to be sequential, like:
slide_01.jpg, slide_02.jpg and slide_03.jpg and so on...
Also it looks like it would need some significant modification to get it to load a given number of random images from a directory, rather than loading all images in the directory.
To get the what I'm after, I'm thinking, I'll have to use a server side approach, but I keep getting 504 access denied when trying Ajax requests, and Wild Apricot's editor just comments out PHP...
-
Kerrie-Anne commented
Look for something using Jquery should do the trick - something like this perhaps?
http://www.justinwhall.com/directory-jquery-slider/
I've used it successfully elsewhere, but not on a WA site, so it might do the trick!