Displaying images via Lightbox
2 posts by 2 authors in: Forums > CMS Builder
Last Post: October 7, 2008 (RSS)
By ScottL - October 6, 2008
When I'm viewing the images in a photo gallery via Lightbox, I'm getting the thumbnail and full size images in the rotation. If the gallery has 4 images, it is displaying 8 images.
Here's my code:
<a href="<?php echo $upload['urlPath'] ?>" rel="lightbox[<?php echo $photo_galleryRecord['title'] ?>]" title="<?php echo $upload['info2'] ?>"><img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" /><br/>
The code between the brackets [ ] causes Lightbox to create a slideshow with the NEXT button. What I used below is showing thumbnails and full size images.
What should be used to display only the full size images?
rel="lightbox[<?php echo $photo_galleryRecord['title'] ?>]"
Thanks
Here's my code:
<a href="<?php echo $upload['urlPath'] ?>" rel="lightbox[<?php echo $photo_galleryRecord['title'] ?>]" title="<?php echo $upload['info2'] ?>"><img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" /><br/>
The code between the brackets [ ] causes Lightbox to create a slideshow with the NEXT button. What I used below is showing thumbnails and full size images.
What should be used to display only the full size images?
rel="lightbox[<?php echo $photo_galleryRecord['title'] ?>]"
Thanks
Re: [thinkng] Displaying images via Lightbox
By Perchpole - October 7, 2008
Hi, Thinkng -
This code looks OK. However, it's the PHP which you wrap around the code which is important. You should have something like this...
This tells the system how to display uploads which have thumbnails. If no thumbnails are available, it uses the alternative code.
:0)
Perch
This code looks OK. However, it's the PHP which you wrap around the code which is important. You should have something like this...
<?php foreach ($catalogueRecord['yourimages'] as $upload): ?>
<?php if ($upload['hasThumbnail']): ?>
your code....
<?php elseif ($upload['isImage']): ?>
alternative code...
<?php endif ?>
<?php endforeach ?>
This tells the system how to display uploads which have thumbnails. If no thumbnails are available, it uses the alternative code.
:0)
Perch