Thumbnail Images on Listings Level
7 posts by 2 authors in: Forums > CMS Builder
Last Post: December 19, 2007 (RSS)
By rasbro - December 19, 2007
For example, when I have a multi-page section with a list viewer and page viewer being used, I would like the thumbnail images for the products appearing on the category pages (list viewer) like they do for each of the product pages (page viewer). I hope that makes sense.
What tags do I use on the list viewer page for displaying the product thumbnail images like on the page viewer page?
Thanks,
Brian
Re: [rasbro] Thumbnail Images on Listings Level
By Dave - December 19, 2007
Let me know if you have any other problems with that.
interactivetools.com
Re: [Dave] Thumbnail Images on Listings Level
By rasbro - December 19, 2007
Notice: Undefined variable: record in /home/path-of-site/page.php on line 80
getUploads: no 'recordNum' value specified!
Do I need to alter something?
Thanks,
Brian
Re: [rasbro] Thumbnail Images on Listings Level
By Dave - December 19, 2007
<?php foreach ($listRows as $record): ?>
...
<?php endforeach ?>
Then past your upload viewer code inside that. Like this:
<?php foreach ($listRows as $record): ?>
<?php foreach (getUploads($options['tableName'], 'uploads2', $record['num']) as $upload): ?>
...
<?php endforeach ?>
<?php endforeach ?>
If that doesn't help you can attach the listViewer file (or private message it to me) and I'll have a look.
interactivetools.com
Re: [Dave] Thumbnail Images on Listings Level
By rasbro - December 19, 2007
Now, I wonder if there is a way to have the product thumbnail appear smaller on the category list page than it does for the product page, without just changing the width and height attributes. Can I do this without adding a new section for this purpose?
Thanks,
Brian
Re: [rasbro] Thumbnail Images on Listings Level
By Dave - December 19, 2007
The first size is set with "Resize images larger than...". Any images uploaded larger than this will automatically be resized. You can display these images like this:
<img src="<?php echo $upload['urlPath'] ?>"
width="<?php echo $upload['width'] ?>"
height="<?php echo $upload['height'] ?>" />
The second one is the thumbnail created with "Create image thumbnails". That will automatically get created if enabled and can be displayed like this:
<img src="<?php echo $upload['thumbUrlPath'] ?>"
width="<?php echo $upload['thumbWidth'] ?>"
height="<?php echo $upload['thumbHeight'] ?>" />
And if you want to just let the browser resize it, using the thumbnail will give you less distortion since it's already smaller and specifying only height or width will make the browser figure out the right resize ratio:
<img src="<?php echo $upload['thumbUrlPath'] ?>" width="50" />
Hope that helps.
interactivetools.com
Re: [Dave] Thumbnail Images on Listings Level
By rasbro - December 19, 2007
Thanks for the great explanation!
Brian