All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

Skip to First alpha listing

Brendan Underwood 27 Sep 2011 09:35 question, complete

Wondering if there's some way that I can skip to the first letter available if no alpha segment is present in the URL.

ie. a user goes to:
http://www.example.com.au/atoz/

Which by default, will give them a listing of all items. But if the first low_alphabet_label is say 'C', if they hit the above URL, I'd really prefer the listing either default to start with 'C', or do a redirect to:
http://www.example.com.au/atoz/c/

Any ideas how?

Replies

  1. Low 27 Sep 2011 09:40

    Hey Brendan,

    Something like this will probably work:

    {if segment_2 == ''} 
    {exp:low_alphabet:azlist channel="mychannel"}
    {if count == 1}{redirect="/atoz/{low_alphabet_url}"}{/if}
    {/exp:low_alphabet:azlist}
    {/if}

  2. Brendan Underwood 27 Sep 2011 09:44

    That did the trick, for those playing at home, don't forget to change the 'channel' parameter in the code provided by Low above.

    Thanks for the super fast reply.