Forum

Thread tagged as: Problem, PayPal

Problem creating and using multiple image sizes

I need to create 4 different sizes of each image I upload to the Paypal Shop and have the following in the product.html shop template (which I think is the correct place to do this):

<img src="<perch:shop id="productImage" label="Image" type="image" width="580" height="852" bucket="shop-images" />" alt="<perch:shop id="productTitle" />" />

.
.
.

<!-- Image for Product Listing on Shop home page -->
<perch:content id="productImage" type="image" width="263" height="197" crop="true" bucket="shop-images" suppress="true" />
<!-- Image for Product Listing on category.php -->
<perch:content id="productImage" type="image" width="126" height="156" crop="true" bucket="shop-images" suppress="true" />
<!-- Image for Random products in footer area of pages -->
<perch:content id="productImage" type="image" width="248" height="186" crop="true" bucket="shop-images" suppress="true" />

However, the only image sizes I am getting, is the original, one at 580x852 and a thumbnail which I presume is automatically generated by the system (file name is imagename@2x.jpg). None of the other 3 image sizes are being generated / saved. What am I doing wrong?

My other problem is that I don't know how to load the correct size image in each template - how do I reference which image [size] to load (for example I need the 126x156 size image on the shop home page)??

Emma Davis

Emma Davis 0 points

  • 7 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

You are using perch:content and not perch:shop tags

If your template is a shop template then use perch:shop. You then just use the correct tag for that size on your other template.

Whoops, completely missed that I was using content instead of shop ;)

Can you expand on what you mean by using the correct tag for that size please. Or do you just mean the same that I am using in the product.html template as below?

<perch:content id="productImage" type="image" width="126" height="156" />
Rachel Andrew

Rachel Andrew 394 points
Perch Support

Yes, the same tag with the height and width information.

Thank you Rachel :)