I have a people page that is separated into three different categories, and I am using Low Reorder to allow my client custom control over what order the people are displayed in each category. That part works great. Now I'm trying to customize the output so that the final entry in each category is tagged with a specific class so that the layout will work right.
Here is what my template code looks like:
{exp:channel:categories style="linear" channel="People" show_empty="no"}
<h3>{category_name}</h3>
<div class="row">
{exp:low_reorder:entries set="staff" category="{category_id}"}
<div class="large-3 columns text-center{if count == total_results} end{/if}">
<p>... CE Image stuff ...</p>
<h4 class="staff-grid-name"><a href="{page_url}">{count} {title} {total_results}</a></h4>
<p class="organization-title staff-grid">{exp:low_widont}{person_organization_title}{/exp:low_widont}</p>
</div>
{switch='|||</div><div class="row">'}
{/exp:low_reorder:entries}
</div>
{/exp:channel:categories}
The relevant bit is this: {if count == total_results} end{/if}
. I added in the {count} {title} {total_results
so I could see what the count and total_results fields were.
The output I get is this:
- All entries in the first category have a count of 1 and total_results of 3
- All entries in the 2nd category have a count of 2 and total_results of 3
- All entries in the 3rd category have a count of 3 and total_results of 3
- Since all the 3rd category entries have total_results of 3, all entries in that category are tagged with the "end" class
Perhaps there's another way to achieve what I'm trying to do? Thanks!
UPDATE: I was able to achieve the desired layout effect by just giving all of the entries the 'end' tag, but this is inelegant to be sure. I am still interested in solving this problem the "right" way.