Currently, the menu item type "List All Categories in an Article Category Tree" (com_content.categories) does not provide any sorting parameters in its configuration.
While other category views (such as "Category Blog" or "Category List") allow administrators to choose between "Manager Ordering", "Alphabetical", or "Reverse Alphabetical", this specific tree view is hardcoded to follow the manual ordering set in the Category Manager.
For websites with a large volume of categories (e.g., industry directories, event portals), maintaining an alphabetical list via manual drag-and-drop in the backend is extremely inefficient and prone to errors.
The goal is to align the com_content.categories view with the "Category Blog" view by adding an orderby_pri (Category Order) parameter to the menu configuration.
File: administrator/components/com_content/forms/item_categories.xml
A new field should be added to the basic fieldset to allow selection of the sorting method:
<field
name="orderby_pri"
type="list"
label="JGLOBAL_CATEGORY_ORDER_LABEL"
description="JGLOBAL_CATEGORY_ORDER_DESC"
default="none"
>
<option value="none">JGLOBAL_NONE</option>
<option value="alpha">JGLOBAL_TITLE_ALPHABETICAL</option>
<option value="ralpha">JGLOBAL_TITLE_REVERSE_ALPHABETICAL</option>
<option value="order">JGLOBAL_CATEGORY_MANAGER_ORDER</option>
</field>
File: components/com_content/src/Model/CategoriesModel.php
The getListQuery (or the equivalent method responsible for fetching the tree) needs to be updated to respect this parameter.
Logic Example:
// Retrieve the parameter from the menu item settings
$categoryOrder = $this->params->get('orderby_pri', 'none');
// Apply sorting to the query object
switch ($categoryOrder) {
case 'alpha':
$query->order($db->quoteName('a.title') . ' ASC');
break;
case 'ralpha':
$query->order($db->quoteName('a.title') . ' DESC');
break;
case 'order':
default:
$query->order($db->quoteName('a.ordering') . ' ASC');
break;
}
UX Improvement: Administrators of large portals won't need to manually sort hundreds of categories.
Consistency: Brings parity between different com_content menu types regarding sorting capabilities.
Automation: New categories will automatically fall into the correct alphabetical position without manual intervention.
Joomla 4.4.x / 5.x.x / 6.x.x
Component: com_content
View: categories
| Labels |
Added:
No Code Attached Yet
|
||
| Status | New | ⇒ | Closed |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2026-02-26 18:10:00 |
| Closed_By | ⇒ | HLeithner |