Skip to content

Instantly share code, notes, and snippets.

@objectivehtml
Last active December 19, 2015 19:49
Show Gist options
  • Save objectivehtml/6009226 to your computer and use it in GitHub Desktop.
Save objectivehtml/6009226 to your computer and use it in GitHub Desktop.
{exp:stash:set no_results_prefix="nested_" parse_tags="yes"}
{stash:page_title}Contacts{/stash:page_title}
{stash:form}
<div id="basic">
{exp:channel_search:form id="Member Basic" class="search clearfix"}
<div class="basic clearfix">
<div class="inline">
<label for="search" class="search-label"><i class="icon-search"></i></label>
<input type="text" name="q" value="{form:q}" class="search-input" id="search" />
<button type="submit" class="search">Search</button>
</div>
<div class="search-filter">
<div class="search-filter-opt">
<label for="order_by">Order By</label>
<select name="order_by" id="order">
<option value="member_first_name" {if form:order_by == 'member_first_name'}selected="selected"{/if}>First Name</option>
<option value="member_last_name" {if form:order_by == 'member_last_name' || form:order_by == ''}selected="selected"{/if}>Last Name</option>
<option value="member_city" {if form:order_by == 'member_city'}selected="selected"{/if}>City</option>
<option value="member_state" {if form:order_by == 'member_state'}selected="selected"{/if}>State</option>
<option value="member_zipcode" {if form:order_by == 'member_zipcode'}selected="selected"{/if}>Zip Code</option>
<option value="member_class" {if form:order_by == 'member_class'}selected="selected"{/if}>Class</option>
</select>
</div>
<div class="search-filter-opt">
<label for="sort">Sort</label>
<select name="sort" id="sort">
<option value="asc" {if form:sort == 'asc'}selected="selected"{/if}>ASC</option>
<option value="desc" {if form:sort == 'desc'}selected="selected"{/if}>DESC</option>
</select>
</div>
<div class="search-filter-opt">
<label for="limit">Limit</label>
<select name="limit" id="limit">
<option value="1" {if form:limit == '1'}selected="selected"{/if}>1</option>
<option value="5" {if form:limit == '5'}selected="selected"{/if}>5</option>
<option value="10" {if form:limit == '10'}selected="selected"{/if}>10</option>
<option value="20" {if form:limit == '20' || form:limit == ''}selected="selected"{/if}>20</option>
<option value="50" {if form:limit == '50'}selected="selected"{/if}>50</option>
<option value="all" {if form:limit == 'all'}selected="selected"{/if}>All</option>
</select>
</div>
<div class="search-filter-opt">
<a href="/contacts/search">Advanced Search</a>
</div>
</div>
</div>
{/exp:channel_search:form}
</div>
{/stash:form}
{stash:page_content}
{exp:channel_search:results id="Member Basic" enable="categories" sort="asc" order_by="member_last_name"}
{stash:embed:results:contact process="start"}
{/exp:channel_search:results}
{/stash:page_content}
{/exp:stash:set}
{stash:embed name="structure:header"}
{if nested_no_results}
{stash:form}
<div class="alert-box alert">
<i class="icon-warning-sign"></i> There are no contacts at this time.
</div>
{/if}
{if is_first_row}
{stash:form}
<hr>
{if prev_page || next_page}
<div class="pagination right">
{if prev_page_url}
<a href="{prev_page_url}"><i class="icon-circle-arrow-left"></i> Prev Page</a>
{/if}
{if next_page_url && prev_page_url}
&nbsp;
{/if}
{if next_page_url}
<a href="{next_page_url}">Next Page <i class="icon-circle-arrow-right"></i></a>
{/if}
</div>
{/if}
<div class="search-stats">
{grand_total} Result{if grand_total != 1}s{/if} Found - {total_pages} Page{if total_pages != 1}s{/if}
</div>
<ol class="results plain">
{/if}
<li class="result">
<div class="row">
{if member_photo:total_photos > 0}
<div class="two columns">
<a href="/contacts/profile/{url_title}">{member_photo class="result-photo"}</a>
</div>
{/if}
<div class="{if member_photo:total_photos == 0}twelve{if:else}ten{/if} columns">
<a href="/contacts/profile/{url_title}">
<h4 class="result-title">{member_first_name} {member_last_name}</h4>
<p>
{email}
{if member_phone_number}
<br>{member_phone_number}
{/if}
</p>
</a>
<div class="tags">
{categories}
<a href="#" class="tag">{category_name}</a>
{/categories}
</div>
</div>
</div>
</li>
{if is_last_row}
</ol>
{if prev_page || next_page}
<div class="pagination right">
{if prev_page_url}
<a href="{prev_page_url}"><i class="icon-circle-arrow-left"></i> Prev Page</a>
{/if}
{if next_page_url && prev_page_url}
&nbsp;
{/if}
{if next_page_url}
<a href="{next_page_url}">Next Page <i class="icon-circle-arrow-right"></i></a>
{/if}
</div>
{/if}
{/if}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment