We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

exp:channel:categories order/sort?

How Do I?

Giraffentoast's avatar
Giraffentoast
152 posts
11 months ago
Giraffentoast's avatar Giraffentoast

exp:channel:categories does not return the categories in the correct order (as sorted in the UI) neither there is any parameter that allows sorting them.

Since there is no specific parameter I’d expect the order the same as they maintained/sorted in the categorgy group listing, but it seems they are returned ordered by their category IDs.

We are using the style parameter to output a nested version, so we cannot re-order them ourselfs that easy.

Is there any way to have them returned (in already nested markup) in the order as maintained in the category group UI?

       
Rob Allen's avatar
Rob Allen
3,102 posts
11 months ago
Rob Allen's avatar Rob Allen

Are you caching your templates? I’d suggest clearing the cache anyway.

It can also be your browser serving its own cached pages so doing a hard refresh can work.

       
Giraffentoast's avatar
Giraffentoast
152 posts
11 months ago
Giraffentoast's avatar Giraffentoast

Argh! Good point. Cache (EE/server, not client) it is/was, thanks Rob!

Lars

👍 1
       
catherinehat's avatar
catherinehat
5 posts
2 months ago
catherinehat's avatar catherinehat

Hello @ geometry dash lite, If the built-in functionality doesn’t support ordering as you desire, you might consider using a custom SQL query to fetch categories in the desired order. You can retrieve the categories from the database and sort them according to your needs. However, this requires knowledge of SQL and may not be ideal for all users.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.