Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

How to change image size in the category grid ? 
 
spyderco
Jr. Member
 
Total Posts:  22
Joined:  2008-04-11
 

Hello,

I would change the image size of the product’s images, when the customer browse a category. By default the size of the image is 165*165px.

If i change the image attribute in the css file the image is pixelized.

How i can do that ?

Thx.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Dustin
Sr. Member
 
Total Posts:  160
Joined:  2008-03-13
Columbus, OH
 
spyderco - 30 April 2008 02:52 AM

Hello,


I would change the image size of the product’s images, when the customer browse a category. By default the size of the image is 165*165px.

If i change the image attribute in the css file the image is pixelized.

How i can do that ?

Thx.

Changing Front Image Size
loc: /magento/app/design/frontend/default/default/template/catalog/product/list.phtml
line: 45
orig: <img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135, 135); ?>” width="135" height="135" alt="<?php echo $this->htmlEscape($_product->getName()) ?>"/>

line: 93
orig: <img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135, 135); ?>” width="135" height="135" alt="<?php echo $this->htmlEscape($_product->getName()) ?>"/>

 
Magento Community Magento Community
Magento Community
Magento Community
 
spyderco
Jr. Member
 
Total Posts:  22
Joined:  2008-04-11
 

Thx

 
Magento Community Magento Community
Magento Community
Magento Community
 
Hobie Brown
Jr. Member
 
Total Posts:  5
Joined:  2010-05-04
 

Hello

Is this possible to do “on the fly” within different categories? Some products require less space than others and it would be good to be able to list more items on some categories than other.

 
Magento Community Magento Community
Magento Community
Magento Community
 
ericscott
Member
 
Total Posts:  57
Joined:  2008-05-14
 
Dustin - 30 April 2008 03:41 AM

spyderco - 30 April 2008 02:52 AM
Hello,


I would change the image size of the product’s images, when the customer browse a category. By default the size of the image is 165*165px.

If i change the image attribute in the css file the image is pixelized.

How i can do that ?

Thx.

Changing Front Image Size
loc: /magento/app/design/frontend/default/default/template/catalog/product/list.phtml
line: 45
orig: <img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135, 135); ?>” width="135" height="135" alt="<?php echo $this->htmlEscape($_product->getName()) ?>"/>

line: 93
orig: <img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135, 135); ?>” width="135" height="135" alt="<?php echo $this->htmlEscape($_product->getName()) ?>"/>

This was exactly what I was looking for!!! Thanks!!!

 
Magento Community Magento Community
Magento Community
Magento Community
 
vbwebsites
Sr. Member
 
Avatar
Total Posts:  93
Joined:  2009-01-12
Virginia
 

what if you want to resize to for instance 560 wide by no set height / proportioned? My items are cues, original is like 2000 wide by 150

I am using this now:

<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image'); ?>" width="540" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />

For some reason, i am locked at 540 wide… How can i change that to be 560 without losing clarity (not stretch but resize at 560)?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Surf Web Design
Member
 
Avatar
Total Posts:  31
Joined:  2011-07-28
Calgary, Alberta, Canada
 

Magento 1.7 catagory images squashed , so to fix that: go to:

magento/app/design/frontend/default/default/template/easycatalogimg/subcatagories.phtml
change line 77 from:

<img src="<?php echo $imageUrl ?>” <?php echo !empty($height) ? ' height="' . $height . '"' : ''; echo !empty($width) ? ' width="' . $width . '"' : '' ?> alt="<?php echo $this->htmlEscape($_category->getName()) ?>” />
to
<img src="<?php echo $imageUrl ?>” <?php echo !empty($height) ? ' height="' . $height . '"' : ''; ?> alt="<?php echo $this->htmlEscape($_category->getName()) ?>” />

Go to magneto back end to cache management and flush image and magento cache. Then test it out.

 
Magento Community Magento Community
Magento Community
Magento Community
 
qinwubi
Jr. Member
 
Total Posts:  6
Joined:  2011-11-01
 

I’m using the galaeverbuy theme from galathemes.com. Did the exactly the same fix but nothing changed at all from the frontend. I cleared
cache, image cache, and even recompiled the code (yes compilation is enabled in my case).

ver 1.6.1

Any suggestion?

ericscott - 10 August 2010 06:50 PM

Dustin - 30 April 2008 03:41 AM
spyderco - 30 April 2008 02:52 AM
Hello,


I would change the image size of the product’s images, when the customer browse a category. By default the size of the image is 165*165px.

If i change the image attribute in the css file the image is pixelized.

How i can do that ?

Thx.

Changing Front Image Size
loc: /magento/app/design/frontend/default/default/template/catalog/product/list.phtml
line: 45
orig: <img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135, 135); ?>” width="135" height="135" alt="<?php echo $this->htmlEscape($_product->getName()) ?>"/>

line: 93
orig: <img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135, 135); ?>” width="135" height="135" alt="<?php echo $this->htmlEscape($_product->getName()) ?>"/>

This was exactly what I was looking for!!! Thanks!!!

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top