developer documentation r21536

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

NameRequiredDefaultDescription
accounttypeOptionalFilters based on the account type
cityOptionalFilters based on the city
countryOptionalFilters based on the country
emailOptionalFilters based on the email address
evenClassOptionalThe 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
fieldsOptionalSee belowComma-separated list of fields you'd like to use. See below for a list of supported fields
firstnameOptionalFilters based on the first name
genderOptionalFilters based on the gender
groupIdOptionalnoneOnly return users in the specified group
lastnameOptionalFilters based on the last name
occupationOptionalFilters based on the occupation
oddClassOptionalThe 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
schoolOptionalFilters based on the school
sortOptionalcreated DESCSortfield. 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'
stateOptionalFilters based on the state
userOptionalFilters based on the username

The following fields for the 'fields' attribute are supported:

Template variables

NameDescription
loop.hasResultsThe contents of this variable will be either 0 or 1, depending on if there are items in the list.
loop.oddClassThe contents of this variable will reflect the "oddClass" attribute. This will only be set for odd rownumbers.
loop.evenClassThe contents of this variable will reflect the "evenClass" attribute. This will only be set for even rownumbers.
loop.indexThe 0-based index of the item in the loop. (Will contain 0,1,2,3,4, etc.)
loop.countThe count of the current item in the loop. (Will contain 1,2,3,4,5 etc.)
loop.currentPageIf 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.currentPage1This 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.totalPagesTotal number of pages avaiable in this loop. This will be 0 if the loop does not support paging.
loop.totalItemsTotal number of individual items. This will be 0 if the loop does not support paging.
loop.pageSizeTotal number of items on 1 single page. This will be 0 if the loop does not support paging.
user.userThe username
user.emailUser's email address
user.firstnameUser's given name
user.lastnameUser's family name
user.address1Address line 1
user.address2Address line 2
user.cellphoneUser's cellphone number
user.phoneUser's homephone number
user.cityUser's city
user.countryUser's 2-letter country code
user.createdCreated date and time
user.friendsNumber of friends
user.geo_latitudeThe user's latitude
user.geo_longitudeThe user's longitude
user.idThe user's unique id
user.metaThe user's meta-data array
user.descriptionThe user's description
user.genderThe user's gender
user.websiteThe user's website
user.occupationThe user's occupation
user.nicknameThe user's displayname/nickname
user.accounttypeThe user's account type. Numeric field.
user.postalcodeThe user's postalcode
user.approvedfilesThe number of approved media items this user has
user.deniedfilesThe number of denied media items this user has
user.unmoderatedfilesThe number of unmoderated media items this user has
user.publicfilesThe number of uploads this user did
user.state2-letter state code
user.offset0-based offset from start of list. Example: the fourth user on the second page, where pages are 50 users long, has offset 53.
user.filterstringProvides 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>".

See also

<< 7.3.58 fm:UserList 7.3.60 fm:UserPrevious >>