Page 1 of 1
[SOLVED] Add thumbnail pic for Products Summary display
Posted: Wed Sep 19, 2012 5:22 pm
by CapereSpiritum
Can anyone point me the way to get Products, summary template to display a thumbnail of the product.
Kinda want it to show before Product name.
Anyone done this before?
Thanks
Simon
Re: Add thumbnail pic for Products Summary display
Posted: Wed Sep 19, 2012 7:59 pm
by otsakir
Add an image field in the field definition of your products and then use CGSmartImage module to display it as thumbnail.
For instance, if your field is named thumb_image, your product summary template may look like this:
Code: Select all
...
{assign var="image_path" value="uploads/Products/product_"|cat:$product_item->id|cat:"/"|cat:$product_item->fields.thumb_image->value}
<img src="{CGSmartImage src=$image_path filter_resize=w,60 notag=1 noembed=1}" />
I have hardcoded the path to the image file with in a long concatenation. There will probably be better ways
of getting the path to the product images directory
Re: Add thumbnail pic for Products Summary display
Posted: Thu Sep 19, 2013 4:29 pm
by delve2013
This was helpful.. how would I display a field definition called "colour" in the detail template?