1

I've got a P&T field for US states set up with values and labels like this:

AL : Alabama
AK : Alaska
AZ : Arizona
AR : Arkansas
CA : California
CO : Colorado
etc...

I need to group entries by state, and the groups should be ordered by state name alphabetically.

CHANNEL ENTRIES TAG:

{exp:channel:entries
        channel="resource_links"
        show_future_entries="yes"
        show_expired="yes"
        status="not closed"
        order_by="resource_link_state"
        sort="asc"
        limit="9999"
        dynamic="no"
    }

I'm using some inline PHP to handle the grouping and that seems to be working fine. The problem is that the states are not coming back in ascending alpha order as I've tried to specify in my channel entries tag.

I'm getting: CA, CO, NM, NJ, OH, TX, LA, IL, FL, NY, NM, NY, AL, AK, AZ, AR, CT, DE, etc.

http://poms.mach1media.com/resource/links-by-state/

Anybody else run into this problem and found a solution?

  • I know this is old, but from the link it looks like it's working now. Willing to share in an answer below what you did? – Stephen Callender Oct 21 '13 at 5:47
-1

You should put the P&T drop down field's option as:

Alabama
Alaska
Arizona
Arkansas
California
Colorado
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.