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.

Brogan

XenForo moderator
Staff member
{{ rand(1,5) }}

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

This guide may be of use.

 
Solution

Warchamp7

Active member
{{ 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?
 
Top