fm:UserList
The UserList allows you to show a list of users from your project.
Example
<fm:UserList fields="id,user">
<fm:Loop>
<a href="/profile/{$$user.id}">{$$user.user}</a><br />
</fm:Loop>
</fm:UserList>
Supported attributes
| Name | Required | Default | Description |
|---|---|---|---|
| evenClass | Optional | The contents of this attribute will be placed in the 'loop.evenClass' template variable, only for even row-numbers. This allows you to give every even row a specific css class | |
| fields | Optional | See below | Comma-separated list of fields you'd like to use. See below for a list of supported fields |
| oddClass | Optional | The contents of this attribute will be placed in the 'loop.oddClass' template variable, only for odd row-numbers. This allows you to give every odd row a specific css class | |
| pageSize | Optional | 100 | The number of items per page |
| sort | Optional | created DESC | Sortfield. You can currently sort on id, firstname, lastname, friends, publicfiles and created. By default this component will sort Descending, to sort Ascending use for example 'friends ASC' |
| startPage | Optional | 0 | The starting page. This is a 0-based index |
The following fields for the 'fields' attribute are supported:
- address1
- address2
- cellphone
- city
- country
- created
- firstname
- friends
- geo_latitude
- geo_longitude
- id
- lastname
- meta
- nickname
- phone
- postalcode
- publicfiles
- state
- user
- vhost
Template variables
This component defines no template variables.
See also
More examples
This lists sorts the Users by the number of friends they have, and displays a gravatar for each user.
<fm:UserList fields="id,email" sort="friends DESC">
<fm:Loop>
<a href="/profile/{$$user.id}"><fm:Gravatar email="{$user.email}" default="monsterid" /></a><br />
</fm:Loop>
<fm:NoResults>
Poor you, no users were found
</fm:NoResults>
</fm:UserList>
developer documentation r17362