How to check album level

Hi,

I would like to use PHP if else statements to show different elements on my page depending on the location within the album/subalbum structure.

My albums:
  • Parent album
    • Sub-album
      • Album 1
      • Album 2
    How can I check if I am in a parent album, a sub-album, or the album itself?

    Thanks.

Comments

  • there is an object method for the parent: `$obj->getParent()`. This will return `NULL` for albums which are the parent.
  • acrylian Administrator, Developer
    And using the template function `getParentAlbums()` you can even count the array returned (null as well if there are no parents) to find out on what level you are.
Sign In or Register to comment.