Tiggles ツ
8/16/2018 - 2:44 PM

OrderByThenBy

Will sort by group, then sort alpha in said group (ie. staff in different departments) (ie: http://cloud.madebyspeak.com/3y281X3c0k1A)


{% assign sorted = List.Items | OrderByThenBy:'FieldValues.StaffCategory', 'asc', 'FieldValues.StaffName', 'asc'  %}
{% assign groupCategory = "" %}
<div class="staff-listing row">
	{% for Item in sorted %}
	    {% assign ItemLocation = Item.FieldValues.StaffCategory %}
	    {% unless groupCategory == ItemLocation %}
	    	<h1 class="staff-listing-header">{{ Item.FieldValues.StaffCategory }}</h1>
	        {% assign groupCategory = ItemLocation %}
	    {% endunless %}
			<!-- this is the staff member's page link-->
			<a class="stafflink" href="{{ Item.FieldValues.StaffLink }}">
				<div class="staff-member">
					<img alt="Staff Member Image" src="{{ Item.FieldValues.Photo }}"> 
					<span>{{ Item.FieldValues.StaffName }}</span>
					<span>{{ Item.FieldValues.StaffTitle }}</span>
					<span class="contactinfo">{{ Item.FieldValues.ContactInfo }}</span>
					<a href="mailto:{{ Item.FieldValues.StaffEmail }}">{{ Item.FieldValues.StaffEmail }}</a>
					<a href="tel:{{ Item.FieldValues.StaffPhone }}">{{ Item.FieldValues.StaffPhone }}</a>

				</div>
			</a>

	{% endfor %}
</div>