5

I use the Joomla module 'Articles Category' to present articles grouped by category.

Under the 'Grouping Options' tab I selected 'Article Grouping -> Category'. But it only provides ordering by title. Now I need to be able to order by category order. How do I achieve that?

Overrides / core modifications are fine.

2 Answers 2

1

This is exactly what I need to have solved, but usable modification nowhere. So I start to looking for solution on my own.

This is how module orders by articles (helper.php):

$articles->setState('list.ordering', $params->get('article_ordering', 'a.ordering'));

I am not sure, but after I checked database category columns, there are lft and rgt, which looks that it can be used for ordering. I will be happy if somebody smarter will approve that I am right.

So, I have these categories:

People (lft: 173, rgt: 182)
-- Leaders (lft: 174, rgt: 175)
-- Internal Staff (lft: 176, rgt: 177)
-- External Staff (lft: 178, rgt: 179)
-- Others (lft: 180, rgt: 181)

I need to order only by subcategories as my main category is empty. But as you can see, it can be also used to order main category over the subcategories.

Finally, I just tried to modify article ordering this way and it works!!! :)

$articles->setState('list.ordering', 'c.lft, '.$params->get('article_ordering', 'a.ordering'));

Maybe it will be also helpful for others.

0

You can achieve this if you adjust following options in tab 'Filtering Options'
1. Category Filtering Type - Inclusive
2. Category - add all categories you want to show articles from
3. Child Category Articles - if you have them adjust accordingly

2
  • This does not affect ordering of categories when Grouping Options is being activated. From there only order by title is being provided.
    – Pieter
    Commented Feb 15, 2016 at 10:43
  • You are right. Categories always get sorted by category title, regardless to the order in which they are added to option 2. Category. Only solution then might be view override, but I don't have a time to research that.
    – Mikan
    Commented Feb 15, 2016 at 11:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.