ZenphotoCMS Forum
How to get title of previous/next album? - 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: How to get title of previous/next album? (/thread-11157.html)



How to get title of previous/next album? - Wete - 2013-06-24

I'd like to have arrows ( > ) in album.php so that visitors can switch to the previous/next album. This works good with
`

">

">

`
..., but I should have a parameter for the title tag. getAlbumTitle only returns the Title of the current album and does not allow parameters. Is it possible to create a workaround?

Wete




How to get title of previous/next album? - acrylian - 2013-06-24

It always comes down to this:
http://www.zenphoto.org/news/zenphotos-object-model-framework
getNext/PrevAlbum return the object of the those albums.




How to get title of previous/next album? - Wete - 2013-06-24

Ah, that part that I did never understand ...




How to get title of previous/next album? - Wete - 2013-06-24

Maybe you could explain me that? (Yes, I read the object model page, but I can't apply it.)




How to get title of previous/next album? - acrylian - 2013-06-24

The basic concept is explained here: http://www.zenphoto.org/news/zenphotos-object-model-framework#global-object-variables

Just that here we get the object via the getNext/prevAlbum functions. Pass that to a variable and use the method to get the title. Exactly the same as in the example.

This is nothing ZP specific, it is general PHP. Please also review the functions documentation on the classes.




How to get title of previous/next album? - Wete - 2013-06-25

Got it:

$_zp_current_album->getPrevAlbum()->get("title")
$_zp_current_album->getNextAlbum()->get("title")




How to get title of previous/next album? - acrylian - 2013-06-25

Actually you should use getTitle(), otherwise it does not work in multilingual mode. get() acccesses a db field directly.

Also getPrevAlbum()->getTitle() would work as well as that returns the object too if there is one.




How to get title of previous/next album? - Wete - 2013-06-25

OK, thanks. Works fine here.
You may have a look:
http://www.musikverein-zunsweier.de/galerie/rpk2009/