Overview
The User Roles tag fetches lists of the user roles on your site so you can do whatever you want with them.
A simple example is to loop through all the roles and list them by handle:
<ul>{{ user_roles }} <li>{{ handle }}</li>{{ /user_roles }}</ul>
Filtering
If you only want a specific role or roles, you can pass their handle(s) using the handle
parameter.
{{ user_roles handle="group_1|group_2" }} // cool stuff goes here{{ /user_roles }}
Parameters
handle
The handle(s) of the roles you want to return. You may specify multiple roles by pipe separating them: {{ user_roles handle="jocks|geeks" }}
.
Variables
Variable | Type | Description |
---|---|---|
handle |
string |
The role's unique identifier. |
title |
string |
The role's display title. |