Help sorting images into columns

2 posts by 2 authors in: Forums > CMS Builder
Last Post: November 11, 2008   (RSS)

Re: [_kate_] Help sorting images into columns

By Dave - November 11, 2008

Hi kate,

The heading is actually no inside a table cell. The first step would be to create a mockup of what you want it to look like. It usually much easier to get the CMS to output something you already have (that's the process I follow).

I'm not exactly sure what the output should be but try this:

<?php foreach ($galleryRecords as $record): ?>
<span class="heading"><?php echo $record['title'] ?></span><br/>

<table border="1" cellpadding="0" cellspacing="0"><tr>

<?php foreach ($record['photos'] as $upload): ?>
<td width="200" align="center" valign="top" style="padding-bottom: 16px;">
<a href="<?php echo $upload['urlPath'] ?>" class="Images" rel="facebox"><img src="<?php echo $upload['urlPath'] ?>" width="100" style="margin: 0 0 10px 20px" /></a><br/>
</td>

<?php $maxCols=3; if (@++$count % $maxCols == 0): ?></tr><tr><?php endif; ?>
<?php endforeach ?>

</tr></table>
<?php endforeach; ?>

<?php if (!$galleryRecords): ?>
There are currently no photos. Please check this page again shortly.
<?php endif ?>


Hope that helps!
Dave Edis - Senior Developer
interactivetools.com