Jump to content

Image filed to thumbnail grid with lightbox.


Peter Knight
 Share

Recommended Posts

This is easy as:

<ul class="thumbs">
<?php
$images = $page->blog_images;
foreach ($images as $image) {
    $thumb = $image->size(106, 106); // or whatever your thumb dimensions are
    echo "<li><a href='$image->url' class='fancybox'><img src='$thumb->url' alt='$image->description'></a></li>";
}?>
</ul>

Assumptions for this code snippet:

  • You will be styling .thumbs via CSS to get the grid style output
  • You are using $(".fancybox").fancybox(); as a trigger
Edited by marcus
  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...