Multi-record displaying in Multiple Columns - help please! :)

3 posts by 2 authors in: Forums > CMS Builder
Last Post: April 17, 2013   (RSS)

By csdesign - April 17, 2013

Oops. Forgot...  The records are displaying in a single column rather than 2 columns. 

http://www.greatbearreflection.com/wildlife-big-game-photography-wy.php

By gkornbluth - April 17, 2013 - edited: April 17, 2013

Hi Tina,

Here's the basic code for a 2 column image layout based on the recipe LIMITING THE AMOUNT OF COLUMNS IN A MULTI ROW IMAGE DISPLAY in the CMSB Cookbook http://www.thecmsbcookbook.com :

<table >
<tr>
<td >
<tr>
<?php foreach ($wildlife_photographyRecords as $record): ?><?php foreach ($record['image'] as $upload): ?>
<td>
<table>
<tr>
<td ><a href="<?php echo $record['_link'] ?>"><img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php
echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" style="border:hidden" /></a>
</td>
</tr>
<tr>
<td ><span class="text_font"><?php echo $record['title'] ?></span>
</td></tr></table>
</td>
<?php $maxCols=2; if (@++$count % $maxCols == 0): ?></tr><tr><?php endif; ?>
<?php endforeach ?> <?php endforeach ?>
</tr>
</table>

Try that and see what you get, and then add in the other fields and the styling that you're using.

Best,

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php