Lise sorting on Sub-category

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
musicscore
Power Poster
Power Poster
Posts: 498
Joined: Wed Jan 25, 2006 11:53 am

Lise sorting on Sub-category

Post by musicscore »

I created a Lise module called Menu to show a restaurant menu on a site.
I created 2 categories :

1 .English
2. Spanisch

Each category contains multiple sub categories examle :

1. English
----- Main Course
----- Salad
----- Small Plates

2. Spanisch
----- Platos principales
----- Buffet de ensaladas
----- Platos pequeños

Then I created some items and select the corresponding categories (multi select).

I create a English page with this Lise command

{LISEmenu action=category category=English orderby=category_position}

I would expect that the categories and subcategories would be sorted by (sub) category postion but it isn's sorted at all.
Trying for 2 days now every combinatie of Lise sorting commands and modifing templates without any luck.

Please help
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1825
Joined: Wed Feb 25, 2009 4:25 am

Re: Lise sorting on Sub-category

Post by DIGI3 »

I had a similar issue with category list but mine was related to showitems: http://dev.cmsmadesimple.org/bug/view/12395

JoMorg is planning to improve that, so you might want to add a comment to the bug report for your issue too as it's probably related.

A short term workaround is to use a UDT to sort the array first, or javascript/jquery to sort it on the user end.
Not getting the answer you need? CMSMS support options
musicscore
Power Poster
Power Poster
Posts: 498
Joined: Wed Jan 25, 2006 11:53 am

[Solved] Lise sorting on Sub-category

Post by musicscore »

Thanks DIGI3

I submitted a bug report.
To sort the subcategories on my site a created a UDT.

Code: Select all

$categories = $params['categories'];

$keys = array_column($categories, 'position');
array_multisort($keys, SORT_ASC, $categories);
$smarty->assign('categories', $categories);
This sorts all the categories on their position in the backend categories tab of the lise module.

Thanks for your help
Post Reply

Return to “Modules/Add-Ons”