nicolasfink Hi, is there a way to determine the order in which the lists are being shown in the front-end? It would be very helpful if at least they could be shown in alphabetical order? Thanks for your advice ! N
Remi_Acyba Hi, The order of the lists displayed in the front-end is determined by the creation date. But it could be a nice feature, I've just added it to our TODO 🙂
nicolasfink Ok, thanks! in the meantime, could you point me to what file and line I need to change to achieve this? I'm working with dozens of lists, and it is very un-practical for the users to look for the right list ;-) Thank you so much!
Tom Hello, It depends where you are displaying the lists. If it is on the subscription module, then you simply have to make an override of the module view and display it the way you want: in the folder /modules/com_acym/tmpl/, copy the file tableless.php or default.php depending on which display mode you chose in the module edition. paste this file in /templates/<Your front template>/html/mod_acym/ (you may have to create the folder mod_acym if it doesn't exist) at the beginning of the pasted file, you can order the list as you need. $visibleLists is the array containing the list IDs used to display the lists. It is the one you need to order. $allLists is the array containing all data on the lists. Keys of this array are the IDs of the lists (that you get from $visibleLists). You can create a temporary array with list IDs as keys and list name as value. Then sort this array (asort() function to keep key association) then replace $visibleLists by the keys of your sorted array (array_keys()).
nicolasfink sorry for the late reply and thanks for your answer. Actually, I'm using the menu item to display my lists. As I am not very experienced, could you help me with that? could you give me the lines of code that I need to change? Any help would be very much appreciated!
Tom Hello, Sorry for the late reply. This will be almost the same. You can create an override of the menu view. in the folder /components/com_acym/views/frontusers/tmpl/, copy the file profile.php paste this file in /templates/<Your front template>/html/com_acym/frontusers/ (you may have to create the folders com_acym/frontusers if they don't exist) at the beginning of the pasted file, you can order the list as you need. The variable you need to order is $data['subscription'] You can use the following code for example (around line 20 before the closing php tag ?>): usort($data['subscription'], 'sortLists'); function sortLists($a, $b) { if ($a->name == $b->name) { return 0; } return ( $a->name < $b->name ) ? - 1 : 1; }
hepco Hi, got the new update, but it was still not possible to sort the lists or I couldn't find it? I have no idea how to change the order manually with this code 🤷 My colleague and I tried, but we failed. It would be great if that could be done soon.
consultnet Hi, I would like to underline the need for such a functionality. Ordering of the lists is quite important also for us. We have more than 20 lists and will add more in future. Can you please update if ordering will be included in one of the next releases? Thanks, Uwe