Print description only if there's one

How can you set zp to print the album description only if it's present?
This is as far as I can go:
`<?php if ( $AlbumDesc ) { ?>

<?php printAlbumDesc(); ?>

<?php } ?>`

It's because I want to get rid of the empty spans in the markup when an album doesn't have a description.
``

Comments

  • acrylian Administrator, Developer
    Those empty spans are needed for the inline editing on the website (you can click there and add text directly.
    Use `printAlbumDesc(false,'',false)`

    Always a good idea to look at the docs:
    http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functionprintAlbumDesc

    Of course something like `if(getAlbumDesc() != "") { echo getAlbumDesc(); }` would work, too.
  • @barbara
    I used the example acrylian did on my last theme. I only used it deciding if I needed to add captioning to a lightbox though. As acrylian said, if you don't have it on your image page you won't be able to edit it from there while logged in as admin. Remember that your gallery views are different when you're logged in than when a normal users views your site.
  • Thanks acrylian! I put
    `<?php if (getAlbumDesc() != "") { ?>

    <?php printAlbumDesc(); ?>

    <?php } ?>` and did the same for the date. Everything is perfect now. :)
Sign In or Register to comment.