Gallery Image: Display a single record item within a list viewer

4 posts by 2 authors in: Forums > CMS Builder
Last Post: December 28, 2008   (RSS)

By avrom - December 27, 2008

HI Dave,

I saw you answered my two other posts and thank you for that - much appreciated ;)) Hope you had a great Christmas and welcome back ^^.

On a different project I am creating a list viewer to display gallery images. I have a multiple table record called "gallery". Within the gallery record are the uploads ;)) I have started the detail viewer gallery.php

In the following code I want to replace the middle section where all the images are displayed with the code that would actually display only the first thumbnail from that record:

Thanking you in advance...
Avrom


<?php foreach ($galleryRecords as $record): ?>
<!-- Display gallery -->
<div id="gallery">

<?php foreach ($record['images'] as $upload): ?>
<?php if ($upload['isImage']): ?>
<img src="<?php echo $record['_link'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="<?php echo $record['gallery_title'] ?>" title="<?php echo $record['gallery_title'] ?>" />
<?php endif ?>
<?php endforeach ?>


<h1><a href="<?php echo $record['_link'] ?>"><?php echo $record['gallery_title'] ?></a></h1>
<p><?php echo $record['details'] ?></p>
</div>
<?php endforeach ?>

Re: [Dave] Gallery Image: Display a single record item within a list viewer

By avrom - December 27, 2008

Perfecto !! Thanks :))

Re: [virgodesign] Gallery Image: Display a single record item within a list viewer

By avrom - December 28, 2008

Hi Dave,

I also found this solution in an earlier posting while looking for something else, I think it works well too:

http://www.interactivetools.com/forum/gforum.cgi?post=67071#67071

<?php $upload = $record['images'][0]; ?>
rest of code...

Cheers
Avrom