Snippets

A collection of useful snippets to re-use across Statamic projects.

Parent page data

Get the parent page’s title/URL (the hard way).

{{ nav from="/" }}
    {{ if is_parent }}
        <a href="{{ url }}">{{ title }}</a>
    {{ endif }}
{{ /nav }}

Simpler option using the “parent” add-on (the easy way).

<a href="{{ parent:url }}">{{ parent:title }}</a>