ExpressionEngine Docs

Member List Tag

Overview

Outputs a searchable list of members, including form filters to sort and limit the members.

Parameters

error_handling=

error_handling="inline"

Choose to display error messages inline (see Error Messages). By default, errors are displayed with the user message template.

return=

return="member/memberlist"

Form Variables

{form_declaration}

This is a required variable in order to use the search form. It creates the opening form tag.

{group_id_options}

Form submission errors are displayed using a “looping pair” as there can be more than 1 error in a form submission.

<select name='group_id' class='select'>
    {group_id_options}
</select>

{order_by_options}

Form submission errors are displayed using a “looping pair” as there can be more than 1 error in a form submission.

<select name='order_by' class='select'>
    {order_by_options}
</select>

{row_limit_options}

Form submission errors are displayed using a “looping pair” as there can be more than 1 error in a form submission.

<select name='row_limit' class='select'>
    {row_limit_options}
</select>

{sort_order_options}

Form submission errors are displayed using a “looping pair” as there can be more than 1 error in a form submission.

<select name='sort_order' class='select'>
    {sort_order_options}
</select>

Variable Pairs

{errors}

Form submission errors are displayed using a “looping pair” as there can be more than 1 error in a form submission.

{errors}
    <p>{error}</p>
{/errors}

Error Tag Pair Parameters

backspace=
backspace="3"

The backspace= parameter will remove characters, including spaces and line breaks, from the last iteration of the tag pair.

Error Tag Pair Variables

{error}
{error}

The error text.

{member_rows}

Date for each member are shown using a “looping pair”.

{member_rows}
    <p>{name}</p>
{/member_rows}

Member Row Tag Pair Parameters

backspace=
backspace="3"

The backspace= parameter will remove characters, including spaces and line breaks, from the last iteration of the tag pair.

Member Row Tag Pair Variables

{member_css}
{member_css}
{join_date}
{join_date format="%m/%d/%Y"}
{last_visit}
{last_visit format="%m/%d/%Y"}
{total_combined_posts}
{total_combined_posts}

{if accept_email} {email_console}

{paginate}

{paginate}
    <p>Page {current_page} of {total_pages} pages {pagination_links}</p>
{/paginate}

See pagination for more details.

Example

{exp:member:memberlist
    return="member/login/forgot-username"
    error_handling="inline"
    email_subject="Your Username"
    email_template="member/email-forgot-username"
    }

    {if errors}
        <fieldset class="error">
            <legend>Errors</legend>
            {errors}
                <p>{error}</p>
            {/errors}
        </fieldset>
    {/if}

    {form_declaration}

        <table id="memberlist" class='tableborder' border="0" cellpadding="3" cellspacing="0" style="width:100%;">
        <thead>
        <tr>
            <td class='memberlistHead' style="width:21%;">Name</td>
            <td class='memberlistHead' style="width:13%;">Forum Posts</td>
            <td class='memberlistHead' style="width:8%;">Email Short</td>
            <td class='memberlistHead' style="width:13%;">Join Date</td>
            <td class='memberlistHead' style="width:13%;">Last Visit</td>
        </tr>
        </thead>
        <tbody>
        {member_rows}
            <tr>
                <td class='{member_css}' style="width:20%;">
                    <span class="defaultBold"><a href="{path:profile}">{name}</a></span>
                </td>
                <td class='{member_css}'>{total_combined_posts}</td>
                <td class='{member_css}'>
                    {if accept_email}
                        <a href="#" {email_console}>Email Console</a>
                    {/if}
                </td>
                <td class='{member_css}'>{join_date  format="%m/%d/%Y"}</td>
                <td class='{member_css}'>{last_visit  format="%m/%d/%Y"}</td>
            </tr>
        {/member_rows}

        <tr>
            <td class='memberlistFooter' colspan="5" align='center' valign='middle'>
                <div class="defaultSmall">
                    <b>show</b>

                    <select name='group_id' class='select'>
                        {group_id_options}
                    </select>

                    &nbsp; <b>sort</b>

                    <select name='order_by' class='select'>
                        {order_by_options}
                    </select>

                    &nbsp;  <b>order</b>

                    <select name='sort_order' class='select'>
                        {sort_order_options}
                    </select>

                    &nbsp; <b>rows</b>

                    <select name='row_limit' class='select'>
                        {row_limit_options}
                    </select>

                    &nbsp; <input type='submit' value='submit' class='submit' />
                </div>
            </td>
        </tr>
        </tbody>
        </table>

        {paginate}
        <div class="itempadbig">
            <table cellpadding="0" cellspacing="0" border="0" class="paginateBorder">
            <tr>
                <td><div class="paginateStat">{current_page} of {total_pages}</div></td>
                {pagination_links}
            </tr>
            </table>
        </div>
        {/paginate}

    </form>
{/exp:member:memberlist}