Member
Member
Wete   2013-06-24, 15:10
#1

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

Administrator
Administrator
acrylian   2013-06-24, 15:19
#2

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

Member
Member
Wete   2013-06-24, 15:39
#3

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

Member
Member
Wete   2013-06-24, 18:15
#4

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

Administrator
Administrator
acrylian   2013-06-24, 18:30
#5

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.

Member
Member
Wete   2013-06-25, 18:30
#6

Got it:

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

Administrator
Administrator
acrylian   2013-06-25, 18:53
#7

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.

Member
Member
Wete   2013-06-25, 19:51
#8

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

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.