Random Images
Posted: Wed Jan 31, 2024 10:19 am
The scenario: The user has uploaded multiple images via File Manager or Gallery.
Now I want to display a random selection of these images on a webpage, like this:
One Image:
Multiple images:
Is there already a solution out there?
If not, how should I go about to solve this task? By creating a User Defined Tag, or a Plugin/Module?
Regards,
Christian
Now I want to display a random selection of these images on a webpage, like this:
One Image:
Code: Select all
{random_image dir="images/Gallery/tiles" assign="myImage" urlonly=1}
<img src="{$myImage}">
Code: Select all
{random_image dir="images/Gallery/tiles" count=6 assign="myImageCollection" urlonly=1}
{foreach $myImageCollection as $myImage}
<div><img src="{$myImage}"></div>
{/foreach}
If not, how should I go about to solve this task? By creating a User Defined Tag, or a Plugin/Module?
Regards,
Christian