fm:UserNext
Makes information about the next user from a user list available.
Example
<fm:UserNext groupId="123">
<fm:Loop>
<h1>Next user:</h1>
<a href="/profile/{$$user.id}?{$$user.filterString}">{$$user.user}</a><br />
</fm:Loop>
<fm:NoResults>
<h1>At start of user list</h1>
</fm:NoResults>
</fm:UserList>
This component is intended to be used within a template arrived at from a user list component. It will accept the same filters and sorting options as a user list and make available details about the next user in that list.
All attributes from the fm:UserList component are supported with the exception of "pageSize" and "startPage". These supported attributes may also be set via GET variables (the query string). Any values filters or sorting set via attributes will override the same parameters within GET variables. This allows the developer to have this component only show the next user matching specific filters without allowing the end user to bypass the filtering.
Supported attributes
| Name | Required | Default | Description |
|---|---|---|---|
| accounttype | Optional | Filters based on the account type | |
| city | Optional | Filters based on the city | |
| country | Optional | Filters based on the country | |
| Optional | Filters based on the email address | ||
| 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 |
| firstname | Optional | Filters based on the first name | |
| gender | Optional | Filters based on the gender | |
| groupId | Optional | none | Only return users in the specified group |
| lastname | Optional | Filters based on the last name | |
| occupation | Optional | Filters based on the occupation | |
| 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 | |
| school | Optional | Filters based on the school | |
| sort | Optional | created DESC | Sortfield. You can currently sort on id, user, firstname, lastname, friends, publicfiles, nickname, city, country, gender, email, unmoderatedfiles, approvedfiles, deniedfiles, active and created. By default this component will sort Descending, to sort Ascending use for example 'friends ASC' |
| state | Optional | Filters based on the state | |
| user | Optional | Filters based on the username |
The following fields for the 'fields' attribute are supported:
- accounttype
- active
- address1
- address2
- approvedfiles
- avatar
- birthdate
- cellphone
- city
- country
- created
- deniedfiles
- description
- firstname
- friends
- gender
- geo_latitude
- geo_longitude
- id
- language
- lastname
- meta
- newsletter
- nickname
- occupation
- phone
- postalcode
- profile_complete
- publicfiles
- state
- unmoderatedfiles
- user
- vhost
- website
Template variables
| Name | Description |
|---|---|
| loop.hasResults | The contents of this variable will be either 0 or 1, depending on if there are items in the list. |
| loop.oddClass | The contents of this variable will reflect the "oddClass" attribute. This will only be set for odd rownumbers. |
| loop.evenClass | The contents of this variable will reflect the "evenClass" attribute. This will only be set for even rownumbers. |
| loop.index | The 0-based index of the item in the loop. (Will contain 0,1,2,3,4, etc.) |
| loop.count | The count of the current item in the loop. (Will contain 1,2,3,4,5 etc.) |
| loop.currentPage | If a pager is involved in this loop, this will contain the current page number (0-based index). If page information is not available, this will be 0. |
| loop.currentPage1 | This value is currentPage + 1. This number can be useful to display the current page number to use user. (people generally count from 1, not 0). |
| loop.totalPages | Total number of pages avaiable in this loop. This will be 0 if the loop does not support paging. |
| loop.totalItems | Total number of individual items. This will be 0 if the loop does not support paging. |
| loop.pageSize | Total number of items on 1 single page. This will be 0 if the loop does not support paging. |
| user.user | The username |
| user.email | User's email address |
| user.firstname | User's given name |
| user.lastname | User's family name |
| user.address1 | Address line 1 |
| user.address2 | Address line 2 |
| user.cellphone | User's cellphone number |
| user.phone | User's homephone number |
| user.city | User's city |
| user.country | User's 2-letter country code |
| user.created | Created date and time |
| user.friends | Number of friends |
| user.geo_latitude | The user's latitude |
| user.geo_longitude | The user's longitude |
| user.id | The user's unique id |
| user.meta | The user's meta-data array |
| user.description | The user's description |
| user.gender | The user's gender |
| user.website | The user's website |
| user.occupation | The user's occupation |
| user.nickname | The user's displayname/nickname |
| user.accounttype | The user's account type. Numeric field. |
| user.postalcode | The user's postalcode |
| user.approvedfiles | The number of approved media items this user has |
| user.deniedfiles | The number of denied media items this user has |
| user.unmoderatedfiles | The number of unmoderated media items this user has |
| user.publicfiles | The number of uploads this user did |
| user.state | 2-letter state code |
| user.offset | 0-based offset from start of list. Example: the fourth user on the second page, where pages are 50 users long, has offset 53. |
| user.filterstring | Provides a string to be used in conjunction with the fm:UserNext and fm:UserPrevious components. This string will contain all filters and sorting that was applied to this user list. Use this in a link as "<a href='/profile/{$$user.id}?{$$user.filterString}'>{$$user.user}</a>". |
developer documentation r21536