Radical Design Course by Jack McDade

From the creator of Statamic

Learn how to make your websites standout and be remembered.

Taking your approach on designing things actually makes it fun, more natural, and overall easier.

— Dominik, Developer

merge Modifier

Merge an array variable with another array variable.

good_ideas:
- Exercise regularly
- Brush your teeth
- Use Oxford Commas
bad_ideas:
- Bath in beans
- Wear sandpaper underwear
- Eat turtle shells

In this template example we'll merge the two arrays and then pull out a single random item from the combined list. For fun!

<h2>Picking a random idea!</h2>
{{ good_ideas | merge($bad_ideas) | sort("random") | limit(1) }}
<p>{{ value }}</p>
{{ /good_ideas }}
<p>Use Oxford Commas</p>
Docs feedback

Submit improvements, related content, or suggestions through Github.

Betterify this page →
Hello there! Are you looking for the Statamic v2 documentation?