What can we do to make it easier to design with Wild Apricot?

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?

0 votes
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)

    We’ll send you updates on this idea

    apaul34208apaul34208 shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    4 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • Kerrie-AnneKerrie-Anne commented  ·   ·  Flag as inappropriate

        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...

      • DotCreativityDotCreativity commented  ·   ·  Flag as inappropriate

        Server-side scripting isn't possible with WA. Your options are to either add all the file names from the directory to an array manually and use that in your script, or if you have access to another server that allows server-side scripting, to upload the images there.

        If you have a lot of images, there are free programs that will create a list of all the file names in a directory and save it to a text file, which will make it easier to create the array.

      • apaul34208apaul34208 commented  ·   ·  Flag as inappropriate

        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...

      Feedback and Knowledge Base

      Wild Apricot Inc. 144 Front Street West Suite 725, Toronto, Ontario, Canada M5J 2L7