User Groups Fieldtype

Pro Feature

Use this fieldtype to create a relationship with User Groups.

user-groups.png Fieldtype UI
Behold! The User Groups Fieldtype!

Overview

The User Group fieldtype is gives your users a way to pick one or more User Groups to attach to the current entry. What you do with that relationship is up to you, but most likely you'll be either listing users or combining it with the User:In tag to protect content or areas of the frontend.

Data Storage

The User Group fieldtype stores the handle of a single group as a string, or an array of handles if max_items is greater than 1.

Templating

The User Group fieldtype uses augmentation to return the title and handle of each Group. You can use pass these values into the {{ user:in }} tag to protect content.

{{ user:in :group="group_field:handle" }}
You are in the {{ group_field:title }} group. Nice!
{{ /user:in }}

Options

max_items

integer

The maximum number of user groups that may be selected.

mode

string

Set the UI style for this field. Can be one of 'default' (Stack Selector), 'select' (Select Dropdown) or 'typeahead' (Typeahead Field).

HR: Section
Learn More!

Learn more about User Groups Fieldtype in these related docs:

Tags

Docs

HR: Section
Docs feedback

Submit improvements, related content, or suggestions through Github.

Betterify this page →