Navigation disappears when there are no images in album

`

<?php while (next_album()): ?>

<?php endwhile; ?>

<?php set_context(ZP_INDEX); while (next_album()):?>

<?php endwhile; ?>

`
I'm having a problem with the above code. Basically, the first while loop is used to display the first image of subalbum and then links directly to that image. The second loop calls the top level navigation. As far as that is concerned everything works as planned.

The problem occurs when there are no subalbums in an album, for some reason the navigation will not display. From what I can tell it's not running the second loop if it generates nothing off the first loop. Are there any problems with the way I have it written? Can I not run 2 next_album loops in a row? -Thanks

Comments

  • acrylian Administrator, Developer
    This is correct, you can't have two next_album() loops as they always the same internal values. For an album navigation we have the print_album_menu plugin.
Sign In or Register to comment.