A replacement for the first party memberlist
template tags and workflow that adds some much needed updates and functionality.
- Usable with native ExpressionEngine Template Tags (no legacy templates needed)
- Allows for Role specific filtering
- Uses GET based search params using colloquial field names (no more
m_field_id_12
) - Pagination based output using ExpressionEngine pagination tags
The various tags available
Outputs the specified details in conjunction with the form
tag. Note there is a no_results
implementation to display a default view.
The available parameters used with the results
Template Tag.
The specific roles, if any, you want to limit the search by. Multiple role_ids can be seperated by a pipe
How many results to return per page; defaults to 20
The number the URL segment is for the offset value (defaults to 2)
The string the preceeds the offset number. Used in conjunction with the url_segment
parameter; defaults to M
The member fields to order results
Whether asc
or desc
. Works in conjunction with order_by
parameter; defaults to desc
.
{exp:member_list:results
role_id="6|7"
limit="10"
url_segment="2"
order_by="last_name|first_name"
}
{if no_results}
<h2 style="border:0;">Unfortunately, there are no members available for your search.</h2>
{/if}
<p>
<span class="news_title">{first_name} {last_name}</span>
<a href="mailto:{email}">{email}</a>
</p>
{/exp:member_list:results}
Generates the search form for use in conjunction with the results
tag.
The available parameters used with the form
Template Tag.
The template(s) to direct users to upon form submission
Any CSS class, if any, to apply to the generated form
Be aware, that the input names are mapped internally to the specific member field IDs. So you'll only use the Short Name to query on.
<div id="member_left">
<p class="">Find a Member</p>
{exp:member_list:form return="{segment_1}"}
<p>First Name: <br />
<input name="first_name" type="text" value="{first_name}" /></p>
<p>Last Name: <br />
<input name="last_name" type="text" value="{last_name}" /></p>
<p>City:<br />
<input name="city" type="text" value="{city}" /></p>
<p>State: <br />
<input name="state" type="text" value="{state}" /></p>
<p>Country: <br />
<input name="country" type="text" value="{country}" /></p>
<p align="center">
<input type="submit" value="Search">
</p>
<p> </p>
{/exp:member_list:form}
</div>
Mostly used in conjunction with the pagination links
{pagination_url}?{exp:member_list:query_string}
<div id="member_left">
<p class="">Find a Member</p>
{exp:member_list:form return="{segment_1}"}
<p>First Name: <br />
<input name="first_name" type="text" value="{first_name}" /></p>
<p>Last Name: <br />
<input name="last_name" type="text" value="{last_name}" /></p>
<p>City:<br />
<input name="city" type="text" value="{city}" /></p>
<p>State: <br />
<input name="state" type="text" value="{state}" /></p>
<p>Country: <br />
<input name="country" type="text" value="{country}" /></p>
<p align="center">
<input type="submit" value="Search">
</p>
<p> </p>
{/exp:member_list:form}
</div>
<div id="directory_right">
{exp:member_list:results
role_id="6|7"
limit="10"
url_segment="2"
order_by="last_name"
}
{if no_results}
<h2 style="border:0;">Unfortunately, there are no members available for your search.</h2>
{/if}
<p>
<span class="news_title">({member_id}) {first_name} {last_name}</span>
<a href="mailto:{email}">{email}</a>
</p>
{if count == {total_results}}
{paginate}
<div class="itempadbig"><p class="pagination">
<table cellpadding="0" cellspacing="0" border="0" class="paginateBorder">
<tr>
<td><div class="paginateStat">{current_page} of {total_pages}</div></td>
</tr>
<tr>
<td>
{pagination_links}
{first_page}
<a href="{pagination_url}?{exp:member_list:query_string}" class="page-first">First Page</a>
{/first_page}
{previous_page}
<a href="{pagination_url}?{exp:member_list:query_string}" class="page-previous">Previous Page</a>
{/previous_page}
{page}
{if current_page}
{pagination_page_number}
{if:else}
<a href="{pagination_url}?{exp:member_list:query_string}" class="page-{pagination_page_number} ">{pagination_page_number}</a>
{/if}
{/page}
{next_page}
<a href="{pagination_url}?{exp:member_list:query_string}" class="page-next">Next Page</a>
{/next_page}
{last_page}
<a href="{pagination_url}?{exp:member_list:query_string}" class="page-last">Last Page</a>
{/last_page}
{/pagination_links}
</td>
</tr>
</table>
</p></div>
{/paginate}
{/if}
{/exp:member_list:results}
</div>