No Code Attached Yet
avatar uzielweb
uzielweb
26 Feb 2026

Problem Description

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.

Proposed Solution

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.

Required Changes:

1. Form XML Update

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>

2. Model Logic Update

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;
}

Benefits

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.

Environment tested

Joomla 4.4.x / 5.x.x / 6.x.x

Component: com_content

View: categories

avatar uzielweb uzielweb - open - 26 Feb 2026
avatar joomla-cms-bot joomla-cms-bot - change - 26 Feb 2026
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 26 Feb 2026
avatar uzielweb uzielweb - change - 26 Feb 2026
The description was changed
avatar uzielweb uzielweb - edited - 26 Feb 2026
avatar uzielweb uzielweb - change - 26 Feb 2026
The description was changed
avatar uzielweb uzielweb - edited - 26 Feb 2026
avatar HLeithner HLeithner - change - 26 Feb 2026
Status New Closed
Closed_Date 0000-00-00 00:00:00 2026-02-26 18:10:00
Closed_By HLeithner
avatar HLeithner HLeithner - close - 26 Feb 2026

Add a Comment

Login with GitHub to post a comment