on every page load.
Code: Select all
{capture assign='num'}{1|rand:10}{/capture}{* generate a random number between 1 and 10, assign it to 'num *}
<img src="uploads/header_{$num}.jpg" width='468' height='50'/>
Code: Select all
{capture assign='num'}{1|rand:10}{/capture}{* generate a random number between 1 and 10, assign it to 'num *}
<img src="uploads/header_{$num}.jpg" width='468' height='50'/>
The power of this tip is its server side non javascript nature. And shortness.KO wrote: I love these tips! And javascript alternatives like this.
Code: Select all
<div id="header">
Code: Select all
{capture assign='num'}{1|rand:10}{/capture}
<div id="header" style="background-image: url(uploads/header_{$num}.jpg)">