Displaying Record Uploads and Descriptions Horizontally

2 posts by 2 authors in: Forums > CMS Builder
Last Post: May 6, 2009   (RSS)

By Cathy - May 5, 2009

I am try to display the uploads for records, in the individual record page, horizontally. These will be pictures with a description - I will be displaying the thumbnails with a click for larger image.

I tried to implement the code I found in some other posts, but obviously I am not doing something correctly.

Here is the code I have to currently display the uploads:

<table width="500" border="0" cellspacing="3" cellpadding="0">
<tr>
<?php foreach ($eventsRecord['images'] as $upload): ?>
<?php if ($upload['hasThumbnail']): ?>
<td width="165" align="center">
<a href="<?php echo $upload['urlPath'] ?>" rel="facebox"><img src="<?php echo $upload['thumbUrlPath'] ?>" alt="" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" border="1" /></a><br />
<?php echo $upload['info1'] ?><br />
<?php echo $upload['info2'] ?> </td>
<?php elseif ($upload['isImage']): ?>
<td width="165" align="center"><img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="" /><br />
<?php echo $upload['info1'] ?><br />
<?php echo $upload['info2'] ?></td>
<?php else: ?>
<td width="165"><a href="<?php echo $upload['urlPath'] ?>"> Download <?php echo $upload['filename'] ?></a></td>
<?php $maxCols=3; if (@++$count % $maxCols == 0): ?>
<?php endif ?>
<?php endforeach ?>
</tr>
</table>


The error I get displayed is:
Parse error: syntax error, unexpected T_ENDFOREACH in /home/content/s/p/e/spectrumlight/html/events.php on line 95

The page can be viewed here:
http://spectrumlightco.com/events.php?POW-Breast-Cancer-Awareness-Event-2

I am trying to display 3 images across with the description for each below the image in the same table cell.

Any suggestions?

Thanks!

Cathy
__________________________________
Grafix Unlimited

Re: [Cathy] Displaying Record Uploads and Descriptions Horizontally

By ross - May 6, 2009

Hi Cathy.

Thanks for posting!

I think you are close on this one but have a bit of the code mixed up. Here's a generic form of what you are looking for:

<table>
<?php foreach ($parent_categoriesRecords as $record): ?>
<td>
display something here
</td>
<?php $maxCols=4; if (@++$count % $maxCols == 0): ?>
</tr>
<tr>
<?php endif ?>
<?php endforeach ?>
</table>


All your image code needs to go where it says "display something here".

Could you give it another shot and let me know how you make out?

Thanks!
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/