if statement problem

2 posts by 1 authors in: Forums > CMS Builder
Last Post: May 16, 2011   (RSS)

Re: [buttermilk] if statement problem

By buttermilk - May 16, 2011 - edited: May 16, 2011

I think I figured this out. I'm pasting the code that worked for me here just in case it helps somebody else.

<table border="0" cellpadding="3" cellspacing="3" style="font-size:9px;">
<tr>
<?php foreach ($inventoryRecords as $record): ?>


<?php if ($record['main_blurb']): ?>
<?php echo $record['content'] ?>
<?php endif ?>


<?php foreach ($record['images'] as $upload): ?>



<td width="170" valign="bottom">

<?php if ($record['main_blurb']): ?>
</td>
<?php else: ?>


<?php if ($upload['hasThumbnail']): ?>
<img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" />
<div class="big_links"><a href="<?php echo $record['_link'] ?>"><?php echo $record['title'] ?></a></div></td>
<?php endif ?>
<?php break ?>


<?php endif ?>


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

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


I can't guarantee this is actually properly coded. Seems to work, though.