Making images show up in Columns

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

I have a field called lamping_options. I have uploaded 4 images to this field. They show up one below the next. I have tried to use the same code as I did on the search page to have them displayed in columns. It does not work, since it treats all the images under lamping_options as one <td>

Here is the code:



<table width="700" align="center" cellpadding="2" cellspacing="2" border="5">
<tr> <?php foreach ($itemsRecords as $record): ?>
<td width="233" align="left">
<?php foreach ($itemsRecord['lamping_image'] as $upload): ?>
<?php if ($upload['hasThumbnail']): ?>
<a href="<?php echo $upload['urlPath'] ?>" rel="lightbox[dia]" alt="" title=""><img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" /></a><br/>

<?php elseif ($upload['isImage']): ?>
<img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="" /><br/>

<?php else: ?>
<a href="<?php echo $upload['urlPath'] ?>">Download <?php echo $upload['filename'] ?></a><br/>
<?php endif ?> <?php endforeach ?>
</td> <?php $maxCols=3; if (@++$count % $maxCols == 0): ?> </tr><?php endif ?> <?php endforeach ?> <tr> </table>

-------------------------------

How can I get each image to be displayed in another column? Is it possible? The reason I need them in one field is because I added a lightbox to them and It will not work if they are independent fields.

Thank You
Attachments:

itemsdetail_001.php 22K