perPage setting for photos only, sub-albums handled separate...?

SinnerG

Joined: 2007-04-19
Posts: 58
Posted: Sun, 2009-05-03 18:28

Hi!

That's about as close to a descriptive subject line I can get. :)

I'm putting together a theme. I would like the paging to only take photos into account and ignore sub-albums. Setting a perPage value seems to get back both child albums and photos.

Is there a way to ensure paging and perPage only looks at photos and excludes child albums? At present, if I use something like the siriux theme, with perPage set to 20 then on an album containing 19 child albums I get 19 albums and 1 photo on the page. I would like to have access to all 19 albums and page the photos in groups of 20.

The idea is that for each page of the current album I can show access to the immediate child albums no matter what page the view is on.

Any clues or pointers on where I can start digging?

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Sun, 2009-05-03 18:59

I remember reading a comment in the code about being able to return all children to a theme, to allow it to sort out its own paging - that might do the trick.

 
SinnerG

Joined: 2007-04-19
Posts: 58
Posted: Sun, 2009-05-03 19:42

I just noted in the code base I have (2.3-svn.. I know, old, but I have extra stuff in it) that there is something like that, but it might be a bit heavy. I've just yanked out the loadTemplate() function in GalleryTheme.class and separated out the switch statement to another function. I can now override this in the theme.inc and pick out the view method required. I found the methods you might be hinting at which will fetch sub-albums or data objects only.

Seems like the right spot since there's a nice comment in there saying "This is lame and not very OO. We should create a view hierarchy that lets them implement their own showPage() method" :D

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Sun, 2009-05-03 19:54
Quote:
We should create a view hierarchy...

Yeah, like that's ever going to happen now ;-)

 
SinnerG

Joined: 2007-04-19
Posts: 58
Posted: Sun, 2009-05-03 20:04

:D Can't wait for 3.0 with a migration path for the DB. Hopefully doing stuff like this is simpler.