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
Lise sorting on Sub-category
-
musicscore
- Power Poster

- Posts: 498
- Joined: Wed Jan 25, 2006 11:53 am
Re: Lise sorting on Sub-category
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.
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

- Posts: 498
- Joined: Wed Jan 25, 2006 11:53 am
[Solved] Lise sorting on Sub-category
Thanks DIGI3
I submitted a bug report.
To sort the subcategories on my site a created a UDT.
This sorts all the categories on their position in the backend categories tab of the lise module.
Thanks for your help
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);Thanks for your help

