Joomla - where is the category ordering stored?

I have a question that may seem simple, but still I could not find the answer. Unlike the articles that are stored in the table jos_content, the categories in the table do jos_categoriesnot have a column with a name orderingor any other that stores the necessary information. I also tried to find something similar in the table jos_assets, but that didn't help either.

I'm hacking the content component a bit and I need to get the child categories ordered by call $parent->getChildren(), or just find the column orderingso that I can create my own query, even if it's not clean, I just need to get it working as soon as possible.

So where can I find the ordering of categories or how to get the method to getChildrenreturn ordered results?

Thanks in advance, Elwhis

+5
source share
1 answer

In the sort order, Joomla is stored in the jos_categories table as a hierarchical tree structure with a set of related nodes. The columns used to set the order are parent_id , lft , rgt , and level .

Assets and menu items are saved in the same way.

You can learn more about Tree Walking on the wiki.

Edit: Joomla 1.6 JCategoryNode :

jimport( 'joomla.application.categories' );

$extension = 'Content'; // com_content
$options['countItems'] = true;
$categoryId = 0;

$categories = JCategories::getInstance($extension, $options);
$categories->get($categoryId);
+7

All Articles