XF 2.1 Is there any template syntax for outputting a random number?

Warchamp7

Active member
I have a number of background images that I'd like to randomly select from. Is there a way to output a random number between certain values using template syntax?
 
Solution
{{ rand(1,5) }}

Change the 1 to the lowest value, and the 5 to the highest.

This guide may be of use.

{{ rand(1,5) }}

Change the 1 to the lowest value, and the 5 to the highest.

This guide may be of use.

 
Solution
{{ rand(1,5) }}

Change the 1 to the lowest value, and the 5 to the highest.

This guide may be of use.


Is there a way to do this within the less files so that it is random each page load or will I have to move my randomized element into a template?
 
Back
Top Bottom