Michel_ VIP
Total posts: 61
10 Май 2015 16:47

I want to have all my categories displayed by alphabetical order.

The main language is English, but I also use 2 others languages. Language component is Falang.

To have the categories in alphabetical order, I change this parameter :

Section General Parameters > Templates > Category Index > Cobalt7 Template (Same problem with other templates)

Cobalt7 Template parameters : General Parameters > Ordering > Name ascending (a-z)

This way, the categories are displayedb by alphabetical order BUT ONLY IN ENGLISH.

For the other languages the order is the same than the english order.

How can I have the categories displayed alphabetically for ANY LANGUAGE ?

Thanks for help.

Regards.

Последние изменения: 22 Май 2015


Sergey
Total posts: 13,748
12 Май 2015 11:41

I am not sure why it is not working with Falang, because i am not exactly understand how it works. But I asume that ORDER BY in SQL query always applied to the same column.

I am really not sure how to make sure it orders on both languages. I'll ask Falang developers and let you know.


Michel_ VIP
Total posts: 61
12 Май 2015 12:36

Thanks for your reply, Sergey.

Falang is based on Joomfish, and you can find the dev doc here :

http://www.joomfish.net/en/the-club/index.php?option=com_content& ;task=category&sectionid=2&id=5&Itemid=15

Falang is very easy to use (nothing to do !, only include the primary key) in a component / module.

If you use a query like :

$query = "SELECT id, title FROM #__js_res_categories ORDER BY title";

All 'title' will be translated but the order is the db non translated title

So you have to re-order the query result according to the translated title.

Regards.


Sergey
Total posts: 13,748
12 Май 2015 16:52

Let's see. There is a posibility that it is not possible with how I get categories. I'll find out and tell you. Perhaps there is no other order but only by ordering. I'll wait for answer from falang and then form my answer.


Michel_ VIP
Total posts: 61
22 Май 2015 08:17

Sergey Let's see. There is a posibility that it is not possible with how I get categories. I'll find out and tell you. Perhaps there is no other order but only by ordering. I'll wait for answer from falang and then form my answer.

Any news ?


Sergey
Total posts: 13,748
22 Май 2015 15:41

Unfortunately sort by title is impossible. We use nested set technique, and it always order by lft or so to say left. And that create continues tree structure.

There is no way to order by title.

But i added c.title into select, let's see how it will work after update.

Работает на Cobalt