Friends 1.x

Legacy documentation for Friends 1.x.

The Friends:Group_Members function allows you to display lists of users that belong to a given group, as well as ingoing/outgoing join requests that have not yet been confirmed.

{exp:friends:group_members} content {/exp:friends:group_members}

Parameters

The following parameters are available for use:

dynamic=

dynamic="off"

This parameter is available to stop the loop from looking into the URI for an ID of any type.

friends_group_id=

friends_group_id="{segment_3}"

This parameter is available for you to hardcode, embed or pass from segment a friends group ID.

group_name=

group_name="best_group_ever"

This parameter is available for you to hardcode, embed or pass from segment a Friends group short name.

limit=

limit="10"

This parameter controls how many results will be outputted. The limit will default to 100 members if a value is not specified.

member_group_id=

member_group_id="5|6|9"

This parameter allows you to filter the results by one or more member group ID's. Separate multiple groups with the pipe (|) character.

orderby=

orderby="screen_name"

This parameter gives you the ability to control the order in which your results are ordered in the list. You can order by any variable that you can parse on as well as random.

paginate=

paginate="both"

This parameter allows you to control where the pagination will display. Options are top, bottom, or both. Used in conjunction with the friends_paginate variable pair.

screen_name=

screen_name="ja"

This parameter allows you to filter the results by those members who share the same first few letters of their screen name. For example, if you specify ja in the parameter, your results may be Jason, Janet, Jared, etc.

sort=

sort="desc"

You can sort by asc or desc.

type=

type="confirmed"

This parameter allows you to filter the list of friends by the status type. Options are:

  • confirmed (default) - users that are confirmed members of the group.
  • request - requests from users to join the group.
  • invite - invitations sent out from the group owner.

username=

username="fur"

This parameter allows you to filter the results by those members who share the same first few letters of their username. For example, if you specify fur in the parameter, your results may be furly, furby, furnace_eater, etc.

Variables

All standard and custom member fields and usual Friends variables are available for use here. Additionally, these exist as well:

friends_count

{friends_count}

This variable outputs the display order number for each result in the list of users.

friends_group_join_date

{friends_group_join_date format="%F %j, %Y"}

This variable displays the date of when the user became a member, or when the request/invite occurred.

friends_switch

{friends_switch="one|two"}

This variable allows you to switch a CSS class back and fourth for all outputed results.

friends_total_results

{friends_total_results}

This variable outputs the total amount of results outputted in your list.

Variable Pairs

The following variable pairs are available for use:

friends_paginate

{friends_paginate}
    Page {friends_current_page} of {friends_total_pages} pages
    {friends_pagination_links}
{/friends_paginate}

Pagination is available for this tag and works just like regular pagination, but each variable is prepended with friends_. Used in conjunction with the paginate parameter.

Conditionals

You can run conditionals on any of the single variables available above. Additionally, these are available:

if friends_no_results

{if friends_no_results}
    Sorry, no results were found.
{/if}

This conditional evaluates to true and displays it's contents when there are no results found for this tag.

Examples

The code below will output a simple list of all confirmed members of the group:

<h3>Confirmed Members</h3>

<ul>
{exp:friends:group_members
    group_name="{segment_3}"
    type="confirmed"
    orderby="screen_name"
    sort="asc"
}
    <li>
        <a href="{path='friends/profile'}/{friends_member_id}/">{friends_screen_name}</a>
        (Confirmed on {friends_entry_date format="%F %j, %Y"})
    </li>
{/exp:friends:group_members}
</ul>

The code below will output a simple list of all invited members of the group:

<h3>Invitations Sent Out</h3>

<ul>
{exp:friends:group_members
    group_name="{segment_3}"
    type="invite"
    orderby="screen_name"
    sort="asc"
}
    <li>
        <a href="{path='friends/profile'}/{friends_member_id}/">{friends_screen_name}</a>
        (Invite sent on {friends_entry_date format="%F %j, %Y"})
    </li>
{/exp:friends:group_members}
</ul>

The code below will output a simple list of all members requesting to join the group:

<h3>Requests to Join the Group</h3>

<ul>
{exp:friends:group_members
    group_name="{segment_3}"
    type="request"
    orderby="screen_name"
    sort="asc"
}
    <li>
        <a href="{path='friends/profile'}/{friends_member_id}/">{friends_screen_name}</a>
        (Requested on {friends_entry_date format="%F %j, %Y"})
    </li>
{/exp:friends:group_members}
</ul>