Member
Member
breglis   2010-01-12, 00:16
#1

how do I get a parent's parent album name ?

Can someone help ?

Member
Member
breglis   2010-01-12, 00:25
#2

got it my self thanks : $_zp_current_album->getParent()->getParent()->name

Member
Member
sbillard   2010-01-12, 00:27
#3

You should actually review the zenphoto object model. But I will save you some time.

$parent = $album->getParent() will give you the parent of an album. Of course, there may not be a parent (if it is a root level album.) In that case you will get NULL.)

Of course, $parent will itself be an album so [drum roll] $grandparent = $parent->getParent() the album's parent's parent.

From there you just use the getFolder() method for the folder name.

Administrator
Administrator
acrylian   2010-01-12, 10:54
#4

If you actually wanted to get the toplevel album to a subalbum there is also
http://www.zenphoto.org/documentation/functions/_functions.php.html#functiongetUrAlbum

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