Show all albums and sub albums in index.php

Hi,

Im trying to show all albums and their sub albums in index.php.

I have tried to use the "while (next_album(true).." loop, but it only show the top level albums. What am I doing wrong?

Comments

  • acrylian Administrator, Developer
    That is how it is supposed to work. You have to use the object model within the loop instead:
    http://www.zenphoto.org/news/zenphotos-object-model-framework

    Quick example to get the title of a subalbum within the loop:
    `
    $subalbs = $_zp_current_album->getAlbums();
    foreach($subalbs as $subalb) {
    $obj = newAlbum($subalb);
    echo $obj->getTitle()."
    ";
    }
    `
    This of course gets only the next sublevel.
Sign In or Register to comment.