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?

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Tue, 2009-06-16 03:49

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

 
appelflap

Joined: 2009-06-16
Posts: 23
Posted: Thu, 2009-06-18 13:53

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.

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Thu, 2009-06-18 18:31

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

 
appelflap

Joined: 2009-06-16
Posts: 23
Posted: Thu, 2009-06-18 21:59

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.

 
steliosv

Joined: 2010-11-23
Posts: 5
Posted: Sun, 2010-11-28 02:49

does anyone know if there's an update to this or if the sort by type feature is in gallery3?

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Sun, 2010-11-28 03:07

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