Two logos on each row?

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

By einslistir - September 25, 2009

I need help for a good looking presentation of some logos.

What I would like to do, is uploading small logos (each with a link, so people, with a mouseclick on the logo, can go to a homepage).

All the logos then should be seen in a table with two coloumns but as many rows as needed, so there always will be two logos on each row, like this: Logo 1 and 2 on the first row, logo 3 and 4 on the second row, logo 5 and 6 on the third row and so on.

Also, if I want to delete logo 3, then logo 4 and 5 should be on the second row.

How can I do this with CMS Builder?

Re: [einslistir] Two logos on each row?

By Chris - September 25, 2009 - edited: September 25, 2009

Hi einslistir,

You certainly can! I think the simplest approach would be to use code like this to output your logos in two columns:

<table>
<tr>
<?php foreach ($blogRecords as $record): ?>
<td>
<?php echo $record['name'] ?>
</td>
<?php $maxCols=2; if (@++$count % $maxCols == 0): ?>
</tr><tr>
<?php endif ?>
<?php endforeach ?>
</tr>
</table>


Note that you'll want to replace the code in red with your own details.

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

Re: [einslistir] Two logos on each row?

By Chris - October 6, 2009

Hi einslistir,

Great to hear you've got this working. :)

Yes, you can change that number to change the number of columns.
All the best,
Chris