Show certain links only in subalbums and not albums

Hi,

I would like to show the following link ONLY on subalbums and not on the main albums:

<?php printPPSlideShowLink(gettext('Slideshow')); ?>

I'm sure there must be some kind of way to differentiate albums and subalbums with an IF statement but I'm not aware of one.

Any help would be greatly appreciated!!!
Thanks

Comments

  • acrylian Administrator, Developer
    There is a album class method `getParent()`. So try `if($_zp_current_album->getParent())) { ....}` should be it.
  • If your theme is already mature, another possibility would be to enable the "multiple_layouts" extension and have different layouts for your main albums and subalbums.

    Basically, open your "theme" folder, copy "album.php" in the same folder as "albumwithoutslideshow.php", remove the slideshow from the latter and voilà! You then select "albumwithoutslideshow.php" as the one to use for main albums and other circumstances where you don't want the slide show.

    Advantage of this method: you have an even greater design flexibility.
    Drawback: if you modify your theme, you have two pages to update.
  • acrylian Administrator, Developer
    Yes, that's a way but probably a little too much if it is just about this one link.
  • Thank you both for the great tips...acrylian, I tried yours and it worked well, but I went with Michel's suggestion in the end as it gave me the opportunity to customise my album pages further, which I'd wanted to do for a while.

    Zenphoto rules, thanks for the support!
Sign In or Register to comment.