Create a field to set the ordering of the categories in the backend.
Add the functionality to order the categories according to the order by query in the database: To determine the ordering for the database query, include the getCategoryOrdering method. The desired category ordering preference is fetched in the getChildrenCategories method, a SQL query is built based on this preference, and the resulting order is used to sort and restructuring the array of child categories. The resulting array $orderedChildrenCategories will contain the children categories sorted as per the Joomla database query order.
Testing Instructions
Create different categories and assign them a parent category. (Menu -> Content-> Categories -> New)
Move to site modules and add Articles Categories Module (New -> Articles Categories +). Select Parent Category and find the option for Category Ordering just below it and set according to your choice.
Save the module.
Actual result BEFORE applying this Pull Request
No option to order the categories.
Expected result AFTER applying this Pull Request
You are able to order the categories according to their title and lft values.
f2edf16a-d6ef-4c2b-bd75-0439a652ed42.mov
Link to documentations
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed