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)

By (Deleted User) - March 1, 2009 - edited: March 9, 2009

[font "Calibri"]Hi,

[font "Calibri"]CMS Builder is a great product. Need some help on my first site with CMS Builder.

[font "Calibri"]We have a product group where each product has an image plus a download file (instructions for the product) in PDF format.

[font "Calibri"]In the listing, I only want the thumbnail to show, not download file. I do want it to show in the product detail page but not in the listing page.

[font "Calibri"]This is the page where I want only the image thumbnail to show and not the download file link:

[font "Calibri"]http://www.qualitystrapping.com/strapping_tools/steel_strapping_tools.php?page=1
[font "Calibri"]This is the detailed product page where it shows just fine:

[url "http://www.interactivetools.com/forum/forum.cgi?url=http%3A%2F%2Fwww.qualitystrapping.com%2Fstrapping_tools%2Fsteel_strapping_tools_item.php%3FUSA-1200-MIP-1200-1"][font "Calibri"]http://www.qualitystrapping.com/strapping_tools/steel_strapping_tools_item.php?USA-1200-MIP-1200-1[/#800080][/url]

[font "Calibri"]Is it possible to show only the thumbnail if it is an image and not for download? Or, maybe to tell CMS to show only the FIRST file in the listing which is always a tumb of the product and not a download file?

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