Page 1 of 1
Gallery: Sorting subgalleries manually
Posted: Thu Aug 01, 2024 2:19 pm
by caigner
I know how to arrange the order of images within a (sub)gallery by drag and drop. Works fine.
But I need to arrange the order of subgalleries, but I couldn't find a way. Not by drag and drop and not by any other means.
Do I really have to manipulate data in the database to change the order of subgalleries? I hope not.
Please help!
Christian
Re: Gallery: Sorting subgalleries manually
Posted: Thu Aug 01, 2024 3:57 pm
by DIGI3
I don't think you'd be able to do it in the database as it's just sorting alphanumerically, as they are in the file system. Other than a feature request to the module author, the easiest way would probably be to do it in your foreach loop in the template. This blog post could get you started, with more options available by googling PHP's sort options.
https://cmscanbesimple.org/blog/sort-array-modifier
Of course the other option would be to create your folders with leading numbers, e.g. 001_foo, 002_bar, etc. You could trim those off for display in the template.
Re: Gallery: Sorting subgalleries manually
Posted: Thu Aug 01, 2024 6:47 pm
by caigner
Thanks. I shall give the renaming a try.
A pity, that drag and drop for reordering entries is on a per module base and not a general feature of CMSMS.
Anyway, thanks for your help.
Re: Gallery: Sorting subgalleries manually
Posted: Fri Aug 02, 2024 5:26 pm
by caigner
I just found out how to arrange subgalleries by drag and drop!
1. Open Gallery in the navigation on the left.
2. Open any Subgallery
On top you will see List / Gallery / YourSubGallery
3. Klick on the Gallery link.
You are back to the list of Subgalleries, but now you can re-arrange them by dragging and dropping, like with images.
This is a little bit awkward to get there but it works.