ZenphotoCMS Forum
First and Last Navigation? - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: First and Last Navigation? (/thread-4843.html)



First and Last Navigation? - harootun - 2009-03-13

Hi there,

I just downloaded ZenPhoto and am kicking the tires. It looks like it does a lot of GREAT things without having too many bells and whistles.

I was wondering one thing that I couldn't find addressed anywhere. Is it possible to add "First" and "Last navigation when looking at the main images of an album? I'm thinking not, since I haven't seen any samples of it while poking around, but just thought I'd ask. Still hoping it might be possible.




First and Last Navigation? - acrylian - 2009-03-13

We have function for that, but you will need to add them to your theme files yourself:
http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functiongetFirstImageURL
http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functiongetLastImageURL
Please read the theming tutorial for details.




First and Last Navigation? - harootun - 2009-03-13

This is great. I've managed to add them successfully to my image.php file. But what I can't seem to figure out is how to make them not show up when one goes to the actual FIRST or LAST image in the gallery.

Can't seem to make them disappear the way NEXT and PREVIOUS buttons do if there's no NEXT or PREV. Everything I've tried gives me errors (I'm not exactly a whiz at php).

Any advice appreciated!!!!




First and Last Navigation? - acrylian - 2009-03-13

Use either these functions to check:
http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functionimageNumber
http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functiongetNumImages

Or even better these
http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functionhasPrevImage
http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functionhasNextImage




First and Last Navigation? - harootun - 2009-03-13

Ahhh... now I get it! I was thinking there would be a separate function for hasFirstImageURL or hasFirstImage... now I understand that I can simply use the hasPrevImage and hasNextImage functions. Simpler is always better

Thanks so much!!!