Custom Homepage Gallery

I am trying to make a custom arrangement of thumbnails for my client's homepage, and I am trying to find the best way to go about it. I want to show 3 random thumbnails from 4 albums, each in columns, forming a table of 12 thumbnails on a single page. Clicking a thumb will take you to the detail page for that item. I also want to provide a dynamic search gallery that show 12+ images from a specific query, so I feel like I should keep a separate template for the homepage (I at least need some logic to use different CSS). Is there a way to check which page the user is on and use a different template?

I am customizing the Zenpage theme, as I will have static pages as well as gallery pages.

Here is an image of what I am going for.

I appreciate any suggestions!

Comments

  • `$imagenames = $album->getImages(0,0,'random');` will give you an array of image names from the album in random order. You will of course need to be sure that there are at least three of them.

    `$imageobj = newImage($album,$imagenames[0]);` gives you the image object of the first random image.

    `$imageobj->getThumb();` gives you the thumbnail image link which you can use in an <img src...> tag to display the image in your table.
  • Thank you so much, this is a HUGE help!

    How do I target each album to include thumbs from more than one album on the same page?

    The main part I am still trying to understand is how to include this custom functionality as the default for my gallery index page (3 images each from 4 albums, in columns), but also include a dynamic album with a more standard view (all 12 images from one search). I want the same menu item to remain active for both views. Is this possible?
  • acrylian Administrator, Developer
    It is possible to assign themes to top level albums. Besides that you can do everything on the theme pages directly by coding.

    I suggest to review especially the theming tutorial and the object model tutorial.
  • Your object model tutorial is AWESOME. Thanks for the tips!
  • Here is the code for a custom thumb table in case anyone is curious :)

    `

    <?php $gallery = new Gallery(); ?>
    <?php $albums = array('earrings','rings','necklaces','bracelets'); ?>
    <?php for($n=0; $n<count($albums); $n++){ ?>

    <?php echo $albums[$n]; ?>

    <?php $album = new Album($gallery, $albums[$n]);
    $albumNames = $album->getImages(0,0,'random');

    for($i=0; $i<3; $i++){
    $imgobj = newImage($album, $albumNames[$i]); ?>


    <?php } ?>

    <?php } ?>

    `
  • thanks for the code, I'll try this myself.
Sign In or Register to comment.