2

I am a novice with ExpressionEngine and still learning.

How can one order channel categories in an ascending or descending order ?

For example :

<!-- ABOUT US -->

<li><a href="/corporate">About Us</a>
    <!-- DROPDOWN NAV -->
    {exp:channel:categories channel="corporate" category_group="8" dynamic="no" style="nested" status="{published-status}" show_empty="no" id="nav_categories" class="dropdown"}
    {if category_id != "82"}
        {if category_id != "116"}
    <a href="{path='corporate/topic'}">{cap_category_name_catgrpid-8}</a>
    {/if}
    {/if}
    {if count == "{total_results}"}
        <a href="/get-involved/item/parachutes-sponsors">Our sponsors</a>
    {/if}
{/exp:channel:categories}
</li>

Any suggestion will be helpful

2

The native exp:channel:categories tag doesn't offer any type of sorting parameters. I suggest using GW Code Categories as it has a ton of useful options.

{exp:gwcode_categories
    channel="corporate"
    group_id="8"
    excl_cat_id="82|116"
    orderby="cat_name"
    sort="asc"
    style="nested"
    status="Open"
    show_empty="no"
    id="nav_categories"
    class="dropdown"
}
    ...
{/exp:gwcode_categories}

You can also disregard the category conditionals as I excluded them with the excl_cat_id parameter.

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.