fm:GroupList


fm:GroupList allows you to create a list of groups users created on the system.

Example 1

This example lists the groups for a vhost and shows their name, id and description.

<fm:GroupList> <fm:Loop> Group Name: {$$group.name}, Group Id: {$$group.id}, Group Description: {$$group.description} <BR> </fm:Loop> <fm:NoResults> No groups have been created yet. </fm:NoResults> </fm:GroupList>

Supported attributes

NameRequiredDefaultDescription
createdByOptionalN/AOnly return groups that where created by the given user ID
custom1OptionalN/AOnly return groups that have the given string as their custom1 value
endAfterOptionalnoneA date and time that the returned events must end after
endBeforeOptionalnoneA date and time that the returned events must end before
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
groupTypeOptionalN/AOnly return groups of provided type. 1 = groups, 2 = events, 3 = assignments.
Example: groupType="1,3" will only return groups and assignments in the groupList.
includeChildrenOptionalNoneSpecifies the moderation status of the child-groups (shown in the 'Include child-groups' field on the searchcollection page).
May only be used in combination with the parentGroup attribute.
The possible values are:
  • false - Do not include media from any child-groups
  • Approved - show the media for groups where moderationstatus is 'approved' (2).
  • Not Denied - show the media for groups where moderationstatus is 'not denied' (3).
  • Denied - show the media for groups where moderationstatus is 'denied' (4).
  • All - show the media for all groups (where moderationstatus is either 0, 1, 2, or 3).
mediaIDOptionalN/AOnly return groups that contain the given media
moderationStatusOptionalN/AFilter by this moderationstatus. Possible values are "accepted", "denied", "unmoderated", "moderated", "notdenied","all"
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
pageSizeOptional100Sets the total number of items per page.
parentGroupOptional(empty)Groups support nesting, you can display all sub-groups for a specific parent-group by specifying the ID using this attribute. Specifying 0 indicates you only want the top-level groups. An empty value is the default and indicates that no filtering based on the parent group will be applied.
searchDescriptionOptionalN/AOnly return groups that have the given string in their description
searchNameOptionalN/AOnly return groups that have the given string in their name
searchQueryOptionalN/ASearches using the full-text index on title, description, address and city
sortOptionalcreated DESCSets the sort field. Use the format fieldname ASC/DESC.
NB: To retrieve the groups in the same order they are in the group-event tree sort by "treeleft ASC".
Currently, the following sort fields are supported:
  • created
  • membercount
  • mediacount
  • id
  • approvedmediacount
  • notdeniedmediacount
  • name
  • startdate
  • enddate
  • treeleft
startAfterOptionalnoneA date and time that the returned events must start after
startBeforeOptionalnoneA date and time that the returned events must start before
startPageOptional0Sets the startpage for this list.
uidOptionalN/AOnly return groups that the given user ID is a member of

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.
group.idGroup id
group.nameGroup name
group.descriptionDescription
group.noteThe note field can be used to specify additional information about the group, generally this is only used within the mediafactory
group.logoThe logo is actually a media-id, use this in conjunction with the mediaviewers.
group.thumbUrlThe thumb URL of the logo.
group.publicUrlThe publiuc URL of the logo.
group.createdThe creation date in YYYY-MM-DD HH:MM:SS format
group.startDateThe start date of the event
group.endDateThe end date of the event
group.createdByThis is a user-id
group.parentGroupThis is the id of the group's parent
group.memberCountThis variable contains the total number of group members
group.mediaCountThis variable contains the total number of items associated with the group
group.approvedMediaCountThis variable contains the number of media items associated with the group that have been approved
group.notDeniedMediaCountThis variable contains the number of media items associated with the group that have not been denied
group.notDeniedCommentCountThis variable contains the total number of comments of media items that are either unmoderated or approved files that have not been trashed or deleted.
group.approvedCommentCountThis variable contains the total number of approved comments of successfully convereted media items. It does not contain any media items that have been trashed or deleted.
group.commentCountThis variable contains the total number of comments either unmoderatod, approved or denied for a media item.
group.geo_longitudeThe longitude of the group.
group.geo_latitudeThe latitude of the group.
group.moderationStatusThe current moderation-status for the group. This can be either unmoderated, accepted or denied
group.addressAddress of the group.
group.cityCity the group is in.
group.state2-letter state or province
group.postalcodePostal/zip-code
group.country2-letter country code
group.publisheridBrightcove publisher id
group.custom1A string of custom text, maximum 32 characters long
group.otherThe group's meta-data as an array. Its keys and values are configurable in the community group info page. Because the group's metadata is configurable, its keys differ for each group.
Sample group.other variables for the templates are:
  • {$$group.other.lang} - the group's metadata language
  • {$$group.other.twitterUserName} - the group's metadata twitter username
  • {$$group.other.rules} - the group's rules
group.metaThe group's meta-data as a serialized string
group.metadataThe group's meta-data as an array. Its keys and values are configurable in the community group info page. Because the group's metadata is configurable, its keys differ for each group.
Sample group.metadata variables for the templates are:
  • {$$group.metadata.lang} - the group's metadata language
  • {$$group.metadata.twitterUserName} - the group's metadata twitter username
  • {$$group.metadata.rules} - the group's rules
group.metakeysThe group's meta-data keys as an array. Since a group's metadata is configurable, its keys differ for each group. The group.metakeys allow you to access the group's metadata by parsing through its keys.
Sample group.metakeys are:
  • {$$group.metakeys.0}
  • {$$group.metakeys.1}

The list continues until the last element of the array, which has the key value of: group.Nmetadata - 1
group.NmetadataThe number of meta-data key/value pairs for the group. The first pair has the key value of 0, and the last has the key value of: group.Nmetadata - 1
group.childCountThe number of direct child groups for this group, NOT including child groups of child groups, etc.
group.groupTypeThe group type, which can be one of the following: 1 (Group), 2 (Event) or 3 (Assignment).

See also

More Examples

Example 2

This example lists the approved child groups for parent group 9501, and shows their following fields: id, membercount and approvedCommentCount.

<fm:GroupList parentGroup=9501" includeChildren=approved" fields="moderationStatus, membercount, approvedCommentCount" sort="membercount DESC" pageSize="30" > <fm:Loop> Id: {$$group.id} - group.memberCount: {$$group.memberCount} - group.approvedCommentCount {$$group.approvedCommentCount} <BR> </fm:Loop> <fm:NoResults> No groups have been created yet. </fm:NoResults> </fm:GroupList>

Example 3

This example lists the groups for a vhost and shows their name and metadata as elements of an array (group.metadata.<key>).
Because a group's metadata is configurable, its keys differ for each group, and you must enter the correct metadata key, otherwise the template will break.

<fm:GroupList> <fm:Loop> Group Name: {$$group.name}, Group Id: {$$group.id}, Group Metadata: {$$group.metadata.<key>} <BR> </fm:Loop> <fm:NoResults> No groups have been created yet. </fm:NoResults> </fm:GroupList>