Customised gallery on the front page

Hi,
Firstly, thanks for Zenphoto - I love it :)

Secondly...
I love having the gallery on the front page. However, I'd like to be able to have a different collection of albums on the front page (index.php) than the main gallery.
My main reason is to have a few portfolio albums on the front page, with all other albums showing up in the main gallery page.
Is this possible in a neat way (e.g. showing a collection of sub albums) or will I need to copy the gallery.php code and hack it around for the index page?

I'm using zpgallerific if that helps!

Many thanks in advance!

Comments

  • acrylian Administrator, Developer
    Please read the theming and the object model tutorial.
  • Thank you.
    Dumb question time - can I set $_zp_current_album manually?
    I'm trying to call printCustomAlbumThumbImage() but it obviously needs the current album setting, and I'm trying to do this manually.
  • Yes, of course. But don't do it in the "wrong" place--that is when it has been setup otherwise for some loop. You should check the function `makeAlbumCurrent()` as it is probably what you want. (Don't hold me to the spelling--I did not look it up.)
  • That seems to be exactly what I want - thanks!

    However, I can't get it to work, and I'm not sure why....
    A quick demo:
    If I used the code
    '
    <?php next_album(); ?>
    <?php echo getBareAlbumTitle();?>
    '
    Then it returns 'weddings' on the page

    But if I set it manually:
    '
    <?php makeAlbumCurrent(weddings); ?>
    <?php echo getBareAlbumTitle();?>
    '
    It returns with:
    '
    Fatal error: Call to a member function getTitle() on a non-object in /home/photog/public_html/zp-core/template-functions.php on line 84
    '

    I'm not sure what I'm doing wrong - I've tried the album title as a bare string, with ' and with " and also the album ID from the database. All have the same results.

    Help?!
  • acrylian Administrator, Developer
    Yes, you should probably read the documentation more carefully. `makeAlbumCurrent()` requires the album object. This needs to be created before using this. You NEVER use the title of anything for this but the name

    Within the `next_album` loop the current album is setup anyway for each album listed. If you want to use the `next_album` loop within an album for its subalbums you have to setup its album object before the loop naturally.

    Recommended read:
    http://www.zenphoto.org/2010/02/zenphotos-object-model-framework/
  • D'oh! I was being rather silly and have been looking at the theme .php files only...
Sign In or Register to comment.