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

wrap Modifier

Wraps a string with a given HTML tag. Has the nice benefit of returning null if there is no data, eliminating the need for simple {{ if }} wrappers.

title: As the World Turns
{{ title | wrap('h1') }}
<h1>As the World Turns</h1>

You may also use Emmet-style CSS classes to be added to the tag.

{{ title | wrap('h1.fast.furious') }}
<h1 class="fast furious">As the World Turns</h1>

The wrap modifier also accepts passing in arrays.

team_members:
- Jack
- Jason
- Jesse
- Josh
- Duncan
- The Hoff
{{ team_members | wrap('li') | join(' ') }}
<li>Jack</li>
<li>Jason</li>
<li>Jesse</li>
<li>Josh</li>
<li>Duncan</li>
<li>The Hoff</li>
Docs feedback

Submit improvements, related content, or suggestions through Github.

Betterify this page →