Radical Design Course by Jack McDade

From the creator of Statamic

Learn how to make your websites standout and be remembered.

Bought Jack McDade's course on design. Going through it now...and it is SO well done!

— Justin Jackson, Transistor.fm

random Modifier

Overview

Picks a single random item from an array or collection.

If you are trying to get multiple random items, consider the shuffle modifier.

Example

The YAML

arr:
- Soda
- Pop
- Coke

The Template

{{ arr | random }}
{{ Statamic::modify($arr)->random() }}

The Output

Soda (maybe)
HR: Section
Related Modifiers

These similar modifiers may aid you on your quest.

rotate-vertical

Modifiers

HR: Section
Docs feedback

Submit improvements, related content, or suggestions through Github.

Betterify this page →