List albums first
zaphod82
Joined: 2009-06-13
Posts: 4 |
Posted: Mon, 2009-06-15 06:18 |
Is there a way to place the albums first, then the pictures when sorting an album that has sub albums and pictures? |
|
Posts: 7994
Not yet. Please file a feature request!
---
Problems? Check gallery3/var/logs first!
Bugs/Features? file them here!
Latest code/upgrading: http://codex.gallery2.org/Gallery3:Upgrading
Latest git: http://codex.gallery2.org:Using_Git
Posts: 23
If you really need it and don't have time to wait for an update try this dirty fix :D... but no warranty, I'm not one of the developers.
What you could do is put this on line 50 of your 'modules/gallery/controllers/albums.php' file.
$album->sort_column = "type` ASC, `".$album->sort_column;
It will sort on type first.. alphabetically. So first 'album', then 'movie' and then 'photo'. Within those types it will adhere to the normal sort method.
Posts: 7994
Nice! Is there a ticket for this already? I couldn't find it.
---
Problems: Check gallery3/var/logs first!
file a bug or feature request | upgrade to the latest code | use git
Posts: 23
Created ticket #439
I would have liked putting something in like this: ORDER BY FIELD(type,'album','photo','movie','idontknowwhatelse')
But the sort_order function automatically places the value between ``'s, so it becomes: `value` or with field: ORDER BY `FIELD(.......` and that doesn't work. Also because this sort order has priority, it's not possible to put another column in front of it.
So I still think it should be done carefully, in stead of this fix.. I'm just not that into the code yet to propose something.
Posts: 5
does anyone know if there's an update to this or if the sort by type feature is in gallery3?
Posts: 16504
http://sourceforge.net/apps/trac/gallery/ticket/439
Looks like it's still open.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here