Show only first thumbnail image in listing page or show image only not download file.

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

Re: [RapidWeb] Show only first thumbnail image in listing page or show image only not download file.

By Kenny - March 1, 2009

In the CMS Code Generator, you only need to use the code that displays what you want.

So your full code would be:

<?php foreach ($record['images'] as $upload): ?>
<?php if ($upload['hasThumbnail']): ?>
<img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" /><br/>

<?php elseif ($upload['isImage']): ?>
<img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="" /><br/>

<?php else: ?>
<a href="<?php echo $upload['urlPath'] ?>">Download <?php echo $upload['filename'] ?></a><br/>

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


But you just want to display the picture right? So take out

<?php else: ?>
<a href="<?php echo $upload['urlPath'] ?>">Download <?php echo $upload['filename'] ?></a><br/>


Now you will only be showing the images and not the downloads.

Make sense?

Kenny

Re: [sagentic] Show only first thumbnail image in listing page or show image only not download file.

By (Deleted User) - March 1, 2009

Thank you so much! That was easy to correct. I don't know any PHP, but it was easy to follow your simple instrucitons.

Thanks again!