Users

Allows you attach Users to your content. This can be used to show authorship, team members, or whatever other use you have for showing people with your content.


Preview

Users Fieldtype

Usage

This fieldtype is used to view a list of Users, generally to establish who authored a given entry or page. Setting the default to current will use the currently logged in User.

fields:
  author:
    display: Author
    type: users

Data Structure

The Users fieldtype is a Relate fieldtype, which means the users will be saved asĀ IDs.

jedis:
  - 892jfsd9a90as
  - 134jk1h78dfas

Templating

Use the Relate tag to loop through the IDs and fetch the user data.

<ul>
  {{ relate:jedis }}
    <li>{{ first_name }} {{ last_name }}</li>
  {{ /relate:jedis }}
</ul>
<ul>
  <li>Luke Skywalker</li>
  <li>Yoda</li>
</ul>

Settings

This fieldtype supports the following settings in addition to the defaults.

default

string

The default value. If you specify current, then the logged in user will be selected by default.

max_items

integer

The maximum number of users than can be selected. By default (blank) there is no limit. Setting to 1 will save the value as a string instead of an array and will switch to a select dropdown UI.

label

string

How the values should appear. You may use variables within the string, eg. "{{ first_name }} {{ last_name }}"

Last modified on May 13, 2019