Bonsai Coder
Active member
One of my customizations in 1.x was to have a rotating background image on my site - every time you would refresh the page you would have a different background image.
This was accomplished by editing the PAGE_CONTAINER template and editing/adding the following code:
(In this example it rotates between three images - but you can edit it for any number) Because of the changes in the 2.0 PAGE_CONTAINER template, I honestly don't know how to make this code work any longer. Any help?
This was accomplished by editing the PAGE_CONTAINER template and editing/adding the following code:
Code:
</head>
<xen:set var="$background.1">path/to/background1.gif</xen:set>
<xen:set var="$background.2">path/to/background2.gif</xen:set>
<xen:set var="$background.3">path/to/background3.gif</xen:set>
<body{xen:if {$bodyClasses}, ' class="{$bodyClasses}"'} style="background-image: url('{xen:raw '$background.{xen:calc '({$serverTime} % 3) + 1'}'}');">
<xen:hook name="body">
(In this example it rotates between three images - but you can edit it for any number) Because of the changes in the 2.0 PAGE_CONTAINER template, I honestly don't know how to make this code work any longer. Any help?