Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

E-Commerce Modules /

Discuss about the various e-commerce modules available:
Ecommerce, SS Shop, SilverCart and SwipeStripe
Alternatively, have a look the shared mailinglist.

Moderators: martimiz, Nicolaas, Sean, Ed, frankmullenger, biapar, Willr, Ingo, Jedateach, swaiba

How to add a product image thumbnail to SwipeStripe product categories?


Go to End


4 Posts   2039 Views

Avatar
AdamDimech

Community Member, 6 Posts

23 February 2014 at 5:18pm

Edited: 23/02/2014 5:19pm

I have installed SwipeStripe, SwipeStripe Category, SilverStripe Gallery and SwipeStripe Gallery. What I want to do is add an image beside the description of each product in my shop on the category pages.

At present, my categories page will list each product as a hyperlink with its corresponding price. There are no images.

How do I get category pages to include product images? (Example)

For each product, I can select an image via the Gallery tab and even display a range of images on each product page (ie a thumbnail is generated). What I can't do is take that thumbnail and add it to:

/swipestripe-gallery/templates/Includes/Products.ss

Any help would be most appreciated.

Avatar
frankmullenger

Forum Moderator, 53 Posts

26 February 2014 at 9:00am

Hi Adam,

You probably want to do something like:

<% loop Products %>
$Images.First.SetWidth(200)
<% end_loop %>

Basically, Gallery_PageExtension is applied to the Product class which adds a many_many relation for Images. Hope that helps :-)

Avatar
AdamDimech

Community Member, 6 Posts

3 March 2014 at 1:03am

Thank-you so very much - that was a tremendous help.

I have written this up on my blog so that others can also benefit. The URL is http://code.adonline.id.au/swipestripe-category/

Avatar
frankmullenger

Forum Moderator, 53 Posts

3 March 2014 at 8:39am

Cheers Adam, glad that it's sorted out. Thanks for writing up a blog post!