IF image THEN ...

13 posts by 2 authors in: Forums > CMS Builder
Last Post: May 6, 2008   (RSS)

By Dave - May 2, 2008

Great, glad to hear it's working! For the other it's the same idea:

<td id="sumimg-mainimage">

<?php $mainImages = getUploads($options['tableName'], 'main_image', $record['num']) as $upload); ?>

<?php foreach ($mainImages as $upload): ?>
<?php if ($upload['hasThumbnail']): ?>
<a href="<?php echo $upload['urlPath'] ?>"><img src="<?php echo $upload['thumbUrlPath'] ?>"
width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>"
alt="Product Main Image - <?php echo $upload['filename'] ?>" title="<?php echo $record['name'] ?>" /></a>
<?php endif ?>
<?php endforeach ?>

<?php if (count($mainImages) == 0): ?>
<img src="/images/NoImage-main.jpg" alt="NoImage-main.jpg" />
<?php endif ?>

</td>


Let me know if that does it.
Dave Edis - Senior Developer
interactivetools.com

By Dave - May 6, 2008

Ahh yes, good eye. That was my mistake. Glad it's working now! :)
Dave Edis - Senior Developer
interactivetools.com