Radical Design Course by Jack McDade

From the creator of Statamic

Learn how to make your websites standout and be remembered.

For a software dev like me who has no idea how to create a cute hand-drawn dashed line, this course just 100% works.

— Ira Zayats, Developer

Tags Fieldtype

Users can enter “taggable” values, which are formatted automatically into a YAML list format. It's a lot like the list fieldtype but with a different UI.

Tags Fieldtype UI
The Tags Fieldtype in action!

Overview

Press enter, tab, or , to add a tag. Click an × to remove one. That's all there is to it.

Data Storage

Your tags will get saved as a simple YAML list, like this:

- applesauce
- garbage pants
- socks

Templating

Loop through the array items to display each item's value.

<h1>I've heard rumors of:</h1>
<ul>
{{ tags }}
<li>{{ value }}</li>
{{ /tags }}
</ul>
<h1>I've heard rumors of:</h1>
<ul>
@foreach ($tags as $tag)
<li>{{ $tag }}</li>
@endforeach
</ul>
<h1>I've heard rumors of:</h1>
<ul>
<li>applesauce</li>
<li>garbage pants</li>
<li>socks</li>
</ul>
Hot Tip!

This fieldtype uses the word "taggable" in a generic way. If you're looking for a way to tag/categorize your content on a schema-level, you should read about taxonomies.

Docs feedback

Submit improvements, related content, or suggestions through Github.

Betterify this page →