Hiding Albums without Pics in

Is there a function or plugin that can hide albums until they have pictures in?

Comments

  • fretzl Administrator, Developer
    This works for me.
    Change the next_album() loop.

    `
    <?php while (next_album()): ?>
    <?php if($_zp_current_album->getImages() != NULL) { ?>
    ...

    ...
    <?php } ?>
    <?php endwhile; ?>
    `
  • acrylian Administrator, Developer
    That will work but of course confuse any pagination.

    You could use the object model to write a small function to check and change the publish state.
  • And if you are the one putting the images in the album you could just unpublish the album until you are ready to show the images.
  • Acrylian, do you have any code to do this?
  • acrylian Administrator, Developer
    See the object model tutorial for the basics and then review the methods available on the documentation.
  • I would love someone to help me with that :(
  • I have just realised, when I un publish something, it doesn't hide???
  • fretzl Administrator, Developer
    Maybe you are logged in? You will also see unpublished items then.
  • Ahh! Thanks :)
Sign In or Register to comment.