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

User:Is Tag

Anything inside the user:is tag will only be rendered if the user has a specific role.

Overview

User tags are designed for sites that have areas or features behind a login. The {{ user:is }} tag is used to check if the currently logged in user has a one or more specific roles.

Example

We want to show some content on a page especially for authors.

{{ user:is role="author" }}
<div class="markdown">
{{ content }}
</div>
{{ /user:is }}

Isn't

We also support the negative use case using {{ user:isnt }} tags.

{{ user:isnt role="author" }}
<a href="/apply">Apply to be an author!</a>
{{ /user:isnt }}

Super Users

While super users have permission to do everything, they do not automatically inherit all roles. Keep this in mind when testing your template logic.

Parameters

role|roles

string

The role(s) to check against. You may specify multiple roles by pipe separating them: {{ user:is roles="writer|editor" }}.

Docs feedback

Submit improvements, related content, or suggestions through Github.

Betterify this page →