I would like the header image to change each time the user makes a new session and I would like to images to be in a alist administered by the administrator.
Is there anybody who has tried something like that in Umbraco and knows how to do it ?
You could have a folder in the Media section which contains the images, and set permissions for the administrator.
Then, you could store a random number in a session variable at the start of the session, using either XSLT, standard ASP.Net code in your masterpage or an action handler.
In your masterpage, you add a macro (or code in ASP.Net directly) which chooses an image based on the random number. For example, if your random number is r and your number of images if n, the picture displayed has number r % n.
Change header image
I would like the header image to change each time the user makes a new session and I would like to images to be in a alist administered by the administrator.
Is there anybody who has tried something like that in Umbraco and knows how to do it ?
Thanks
Paul S
Hi Paul,
You could have a folder in the Media section which contains the images, and set permissions for the administrator.
Then, you could store a random number in a session variable at the start of the session, using either XSLT, standard ASP.Net code in your masterpage or an action handler.
In your masterpage, you add a macro (or code in ASP.Net directly) which chooses an image based on the random number. For example, if your random number is r and your number of images if n, the picture displayed has number r % n.
Cheers,
Ruben
Thanks Ruben
I sounds like a good idea using XSLT - the existing nails. Any examples of how to do something like that ?
Thanks
Paul S
Hi Paul,
I don't have an example here unfortunately. But it should be an easy task, and if you get stuck we could help you out here.
Cheers,
Ruben
I'm not quiet sure of how to make the list of images so that I can acces them from XSLT
Paul S
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.