I am using a container component to display a full page background image.
I would like to load up a background image randomly on page load from 1 of 3 images.
Is this possible?
I am using a container component to display a full page background image.
I would like to load up a background image randomly on page load from 1 of 3 images.
Is this possible?
Hi @johnhiggins
Out of the box without additional code I would not know a way to do it. But there ia a Component available which shoul do the job. Look at it here: Random Content
https://forums.realmacsoftware.com/t/cms-random-image-links/56234/3?u=upssjw
You do this with CMS, setup is fairly simple, currently not working in the latest update, Elements moved to CMS 2, but should in the next update ![]()
https://forums.realmacsoftware.com/t/elements-cms-2-is-here/56224/60?u=upssjw
There a 3 examples in the project, 3 and 5 images but could be more, I can help if thats the way you chose
the first page has a very small custom component (free), the second page is Elements components with a very short Twig snippet
you can refresh my test site, to see it working, no thought in the page design, the two pages do something different to display
https://sjwjaw.co.uk/randimage/