3 column display

7 posts by 2 authors in: Forums > CMS Builder
Last Post: June 23, 2014   (RSS)

By degreesnorth - June 19, 2014

Hi

I am using the three column list display

<table width="618" border="0"> <tr>
             
             

             
<h1><?php echo $gold_sponsors_titleRecord['title']; ?></h1>
             
<?php if ($gold_sponsors_titleRecord['intro']): ?><p style="line-height: 120%"><font face="Arial" style="font-size: 12px"><?php echo htmlencode($gold_sponsors_titleRecord['intro']) ?></font></p><?php endif; ?>

<?php foreach ($gold_sponsorsRecords as $record): ?><td>  <a target="_blank" href="<?php echo $record['_link'] ?>">

<img border="0" src="http://www.meetingonthegreen.com.au/cmsAdmin/uploads/<?php echo htmlencode($record['logo_name']) ?>" width="170"></a></td>            

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

however, one image is appearing on it's own above the other (see http://www.meetingonthegreen.com.au/sponsorship_opportunities2.php (gold sponsors and partners).  Can someone please advise how to fix this.

Thanks in advance.

By claire - June 19, 2014

Hi there

I don't think there's an issue with your code. Are you resetting the $count variable after every header?

--------------------

Claire Ryan
interactivetools.com

Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

By degreesnorth - June 19, 2014

Hi Claire

What does that mean - resetting the $count variable?  Where/what should that look like?

Thanks

By degreesnorth - June 22, 2014

Hi Claire

Thanks for this, but that's what I have (or not sure if your last line of code was meant to contain something other than $count = 0;  ?  I have attached the file to see whether you can shed any more info on this. 

By claire - June 23, 2014

No, I just thought I should explain how it works so that the solution will make sense (hopefully!)

Add this line after each of your headers, like so:

<h1><?php echo $diamond_sponsor_titleRecord['title']; ?></h1>
<?php $count = 0; ?>

Do the same for platinum, gold, silver, etc. This should reset the column counter every time you start a new section. It might need to be set to 1 instead of 0 but it's most likely that this will work.

Let me know if that does it.

--------------------

Claire Ryan
interactivetools.com

Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

By degreesnorth - June 23, 2014

Thanks, that fixed it.