How to show in two columns?

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

By esteban - March 1, 2010 - edited: March 2, 2010

How to show this in two columns?
This is list page, i would like to show only uploads [banner 120x60].

<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php

require_once "/home/trener_osobisty/trener_osobisty/cmsAdmin/lib/viewer_functions.php";

list($partnerzyRecords, $partnerzyMetaData) = getRecords(array(
'tableName' => 'partnerzy',
'where' => whereRecordNumberInUrl(1),
'limit' => '6',
));
$partnerzyRecord = @$partnerzyRecords[0]; // get first record

?>


<?php foreach ($partnerzyRecords as $record): ?>
<?php foreach ($record['banner_120x60'] as $upload): ?>
<a href="http://<?php echo $record['link'] ?>" title="<?php echo $record['title'] ?>"> <img src="<?php echo $upload['urlPath'] ?>" alt="" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" border="0" /></a>


<?php endforeach ?>
<?php endforeach ?>

Re: [esteban] How to show in two columns?

By Chris - March 2, 2010

Hi esteban,

Would putting a <br/> after every second image solve the problem? If so, try adding the code in red below:

<?php foreach ($partnerzyRecords as $record): ?>
<?php foreach ($record['banner_120x60'] as $upload): ?>
<a href="http://<?php echo $record['link'] ?>" title="<?php echo $record['title'] ?>"> <img src="<?php echo $upload['urlPath'] ?>" alt="" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" border="0" /></a>

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


I hope this helps. Please let me know if you have any questions.
All the best,
Chris