User-groups Tag
The user_groups
tag is used to return any groups you have added to collate the users on your site.
Overview#
The User Groups tag fetches lists of the user groups on your site so you can do whatever you want with them.
A simple example is to loop through all the groups and list them by handle:
<ul>
{{ user_groups }}
<li>{{ handle }}</li>
{{ /user_groups }}
</ul>
<ul>
<s:user_groups>
<li>{{ $handle }}</li>
</s:user_groups>
</ul>
{{-- Aliasing the groups. --}}
<s:user_groups
as="groups"
>
...
@foreach ($groups as $group)
...
@endforeach
...
</s:user_groups>
Filtering#
If you only want a specific group or groups, you can pass their handle(s) using the handle
parameter.
{{ user_groups handle="group_1|group_2" }}
// cool stuff goes here
{{ /user_groups }}
<s:user_groups
handle="group_1|group_2"
>
// cool stuff goes here
</s:user_groups>
Parameters
handle
string
The handle(s) of the groups you want to return. You may specify multiple groups by pipe separating them: {{ user_groups handle="jocks|geeks" }}
.
Variables
Variable | Type | Description |
---|---|---|
handle |
string |
The group's unique identifier. |
title |
string |
The group's display title. |
Docs Feedback
Submit improvements, related content, or suggestions through Github.
Betterify this page