parent's parent name ?

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

Can someone help ?

Comments

  • got it my self thanks : $_zp_current_album->getParent()->getParent()->name
  • 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.
  • acrylian Administrator, Developer
    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
Sign In or Register to comment.