Hi guys! I am looking to add a random, or preferably a daily, image on a site to keep visitors returning. I have looked at stacks like JW Jukebox, or spinner and others, but they are limited by the number of images you can display. I have over 500 images to display. I would like to warehouse them and then have a random image loaded when the page is viewed. Some stacks will load new content when the page is refreshed. That’s OK but it would be better if a new image was displayed at specified intervals.
Joe makes a stack called Slot Machine. Use that with an image stack that offers warehousing, like Joe’s Warehouse stack, and you are good to go.
There are other warehouse image stacks out there as well.
Robb, Slot machine only supports 30 slots. Am I wrong on this?
Sorry, you are right, I thought it was limitless, but just checked.
Asked Joe about this, you can do this with Total CMS. Upload as many as you like and display one at random.
[SIGH!] Thanks, Robb, but I can’t justify spending $130 CAD just to display a random image on a page, especially when I would only be able to use it on one domain. May I suggest an upgrade to the warehouse stack? If all of the warehoused images had a filename like image-01, image-02, Etc. and you replaced the image number with a variable determined by the setting (eg; 1-2000) and then had another setting where you could choose random, sequential or timed (timing to be determined by other settings), that would be awesome!
Yes, but spin has a limit (according to that page) of 20 spots, Slot Machine has 30 and that was not enough, he needs 500 spots.
Right. I have spin. I also have a few other randomizer stacks but none will do this. Hey developers! New stack opportunity? Just a few boolean operations… how hard can it be?
I was just going to release an update to Slot Machine that allows you to put as many slots as you want. Before I released I just wanted to verify it. I set the number of slots to 500 and I think that my laptop started to melt my legs. RapidWeaver was at 100% for minutes, and I just decided to force quit. It goes without saying that I won’t be releasing this.
This is where Slot Machine shines. It determines what content to display on the server using PHP. Therefore it only sends the exact content down to the browser that is needed.
When Robb first asked me about 500 Slot Machine slots, my reaction was to use Total CMS was for good reason.
- Managing that many images inside of the RapidWeaver project would be extremely difficult. Adding them all in would take an immense amount of time. Your project would be very large in size. I am not sure how well RapidWeaver would perform with that many images on a single page. My guess is that it would not be good at all.
- Total CMS really is a great fit here. You can upload as many images as you want into a Gallery. All of the images stay on your server. On the content size, the CMS can choose as many random images as you would like and display them on the webpage. As I said, seems like a perfect fit.
I hope that this helps.
Joe, of course adding 500 images to a Rapidweaver stack would certainly be overload. That’s why accessing warehoused images would be the way to go. BTW, has anyone considered warehousing other things besides images? Imagine if you could encapsulate any stack into a downloadable, single file, container and then upload that to the server and have it called up in another Rapidweaver stack when needed?
Just a thought.
Funny enough you are also somewhat describing what Total CMS does for you as well. You can create bits on content that can be easily reused anywhere on your site.
I also have a new stack coming called Portal. It will allow you to import RW pages into each other. Sort of like how my older Global Content stacks did. Portal is just much better at it.
I should add that simply requesting the Stacks plugin to create 500 drop zones for you to add in 500 different images would not even work. That one simple task is what caused the behavior that I described above.
If you wanted to be really clever and knew that you were going to warehouse images and numbered them. You could do this with a bit of PHP.
$min = 1;
$max = 500;
$random = random_int($min, $max);
echo "<img src=\"https://www.mywebsite.com/warehouse/image-$random\" alt=\"My Alt Tag\"/>";
Will Woodgate from Stacks4Stacks has the perfect solution with his RandomImage stack: https://stacks4stacks.com/randomimage/
With this stack, you can randomly display warehoused images and set any value you wish to display as many images as you want. Amazingly, Will is offering this stack absolutely FREE! Plus it will work on as many domains as you like. I have donated 15 Euro in support of this stack as well as the many other great stacks that Stacks4Stacks have for free download.
If you want total control over when to display this, or any other stack, he has another suite of 5 stacks called AdvancedPublisher: https://stacks4stacks.com/advancedpublisher/ With this you can control all of the parameters for displaying content based on a plethora of time and date parameters. Download the free demo to try it out.
I want to give a shout-out to compliment Will on providing a great service to the Rapidweaver community. His many free stacks, and the very cool more advanced reasonable priced stacks he provides is amazing. PLus, his response to support questions are fast and comprehensive.
Well done, Will!
So, I gave this some thought since reading.
The existing solutions seem to require you jump through a few hoops.
I tried to simplify this into a new stack, with a punch list:
- Present a random image from a folder on your server that contains a selection of images.
- Do not require the page be PHP.
- Do not limit the number of images that can be picked from.
- Do not require the images have any special naming.
- Do not require the folder only contains images.
- Do show at least one of the images inside of RW (edit and preview modes) before the site is published.
- Have all added functionality of pro image stacks like responsive alignment, max-width, etc…
So I came up with Dealer stack (coming soon).
Awesome! This contains more features than the free RandomImage stack from Stacks4Stacks and I like that you don’t have to require any special naming of the images. Also, have the functionality of pro image stacks is a huge plus. Totally worth buying! Can’t wait for the release!
OK, so I’m getting excited now!
When I saw the promo graphic for the upcoming Dealer stack from Doobox, it gave me an idea. I would like to have a page on one of my websites that had a layout of cards on it, in this case, Tarot cards. By using several random image stacks, I could display a layout of cards that are “drawn” from the virtual deck.
The problem is that there is a likely hood that once in a while the same image would be displayed, ruining the illusion of cards being drawn from a deck.
But what if the Dealer stack also had an ID number on it? If the Dealer stack had a controller stack with it, then perhaps you could put several dealer stacks on one page, assign them a unique ID number, and have the controller stack ensure that none of the Dealer stacks on the page would show the same image.
I am thinking this would be good to do a virtual “card reading”. The purpose of this would be to attract people to the site and could have the URL spread around to their friends who would also want a free Tarot reading.
A modal stack could be used to ensure that each player could only have one reading per day.
What a great SEO scheme to drive traffic to the site!
You could do something similar with standard playing cards. Photographers could use it to display a mosaic of image samples from their portfolio, ensuring that the same image would not show up more than once on the page.
Is this doable?
PLEASE, PLEASE say yes!
Yes. I like it. It makes perfect sense.
I can’t imagine a scenario where you’d have more than one stack on the same page looking at the same folder of images, without wanting each of them to display a unique image.
Consider it done.
Edit: As mentioned in PM…
This will all happen without any extra user input, id’s id’s or any extra settings.
I can’t wait for this! I don’t wish to insult you, so I know you will also have controls to align the images left, center or right?
Yup, I was the first kid on the block to buy it. Can’t wait to try it out!