EE: Low Random plugin
Do you need rotating images or random stuff in ExpressionEngine? Then Low Random is just what you need. This post now provides a place for support for the Low Random plugin.
Download and docs for Low Random can be found in the Software section
Comments
One time less to use clumsy PHP inside EE templates and tags ;)
Thanks a bunch.
Thank you! Yes I also have these request and used to resort to an extermnal php script. This is way more elegant.
Thank a bunch
I was about to start looking at how to do this and am happy EE-Insider mentioned the plugin.
I am trying to use this with an image… mine is not working … canyou give an exact example.
thanks Lance
Lance, make sure the path given in
folderis correct. An example would be:{exp:low_random:image folder="/var/www/mysite/htdocs/images/headers/" filter="masthead"}Perfect. Nice and simple. I was looking for something to give me a random number. Thanks! Low!
This is 500% more useful than what I was just sitting down to write. I, and my clients with rotating header images, thank you! -cds
I’m trying to use this with an image and I can’t get the image to display. It’s displaying the file names, just not the actual JPG.
Taylor, try using an img-tag. Something like this:
<img src="/images/{exp:low_random:file folder="/some/path/to/images/"}" alt="" />It works! Thanks for the help.
Would it be possible to modify this plugin with a feature to insert images from a directory and not have them be randomized?
For example, imagine a directory with a few dozen photos, all nicely sequentially ordered by filename — could the plugin read all of the file names and generate the HTML code for the images tags?
I realize what I describe is contrary to the plugin’s name and function, but this feature request would be an ideal way to quickly link to any number of images or files within a directory…
Good stuff again Low. I can think of a couple nice uses for this.
But for the example here (random headers) why not just put them in an EE weblog and then use the {exp: limit = 1, sort = random}? That should be able to do this *and* it would making adding images easy> In addition it would allow access to all the weblog functionality. For example, a holiday header could be set up to “expire” after a certain date and the next header(s) could take over again. No?
Hey Mark. Of course, you could, no should, use the regular weblog module for the things you describe. If, however, you just need a random image without fuss, you could use this plugin and get rid of a sql query or two while you’re at it. And if you know the names of the relevant images, you could even use the item, number or letter method and save yourself another disk IO. :)