ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Can I sort categories?

September 11, 2009 11:57pm

Subscribe [1]
  • #1 / Sep 11, 2009 11:57pm

    Ville Walveranta

    72 posts

    If I have something like this:

    {exp:weblog:categories weblog="departments" style="linear" category_group="not 14" parent_only="yes"}
    <div class="CR2a1-departmentNavigation-internal border linkbox">
        {category_description}
    
    </div>
    {/exp:weblog:categories}

    How can I (or can I?) sort the output alphabetically? adding sort=“asc” didn’t do anything. The order the department categories categories have been entered into the system is unfortunately not alphabetical order, so I’d need to sort them on output instead.

    Thanks!

  • #2 / Sep 12, 2009 12:40am

    Lisa Wess

    20502 posts

    You can change the sort order in the Category Management area of the CP - that will be reflected on the public site.  You have options for “alphabetical” or “custom” where you can use arrows to manually set the order.

  • #3 / Sep 12, 2009 1:12am

    Ville Walveranta

    72 posts

    Lisa, thanks for response.

    Shucks! I now realize I should’ve probably set up the categories in a slightly different manner. I have top level categories set up as category groups rather than categories in one cateogory group. Instead, I should’ve set up multiople top level categories in one category group (as would make sense). This sorting issue may be the only casualty of the incorrect setup, however, so I need to evaluate whether it’s worth changing (it would potentially result in too many coding changes).

    May have to create the menu manually, for now. 😛

  • #4 / Sep 12, 2009 1:16am

    Lisa Wess

    20502 posts

    Depending on the scope of the issue and the reason you chose category groups over a single category group it may be worth taking the time to stop, go back, and do it right before moving on.  Getting it ‘right” from the beginning can be a great help - and that’s definitely not unique to EE 😉

  • #5 / Sep 12, 2009 2:55am

    Ville Walveranta

    72 posts

    Yes, I need to determine whether I chose category groups over grouper top level categories from ignorance, or whether there was some design decision I’ve forgotten about by now. 😊

    I expect there to be some level of rewrite for 2.0 (of the site, not EE), so that’s the second consideration - whether it’s easier to do then, or do it now.

  • #6 / Sep 12, 2009 1:24pm

    Lisa Wess

    20502 posts

    There won’t be any need to do a rewrite from 2.0’s perspective.  You can choose to coincide a redesign then but EE won’t require it.  Just fyi.

  • #7 / Sep 12, 2009 3:32pm

    Ville Walveranta

    72 posts

    Yeah, I know - that’s why I said “rewrite for 2.0 (of the site, not EE)”. With closer inspection it turns out it was a design decision which, from the hind-sight, could’ve been accomplished the other way, too. However, the sorting was easy to fix with couple of lines of PHP, and changing the grouping of the categories would require fundamental changes to the site, so I let it be for now.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases