Limit Entries List By Letter
I'm trying to create two columns of a low alphabet entries list. The code I'm using is:
{exp:low_alphabet:entries channel="sermon_series" orderby="title" alpha_ignore="the|a" group_numbers="yes" numbers_label="#" disable="categories|member_data|pagination"}
{if count == 1}<div class="alphanum">{/if}
{if low_alphabet_heading}
<div class="section">
<h3>{low_alphabet_label}</h3>
<ul>
{/if}
<li><a href="{lv_homepage}resources/sermons/by-series/{url_title}/">{title}</a></li>
{if low_alphabet_footer}
</ul>
</div>
{/if}
{if count == total_results}</div>{/if}
{/exp:low_alphabet:entries}
For what I need, I need to be able to output two separate lists, one from a-k (including numbers), and one from l-z. I've tried testing {low_alphabet_url} to see if it equals 'k', but this only guarantees a split if there is at least one entry beginning with k (which there isn't always).
Replies
Low 27 Dec 2011 13:36
Hey Ben,
You'd need to enable PHP on output in your template, I think. Store each entry in an array by key (the label), then check how big the array is, and split it in the middle. Then output each half in it's own div.