如何在Magento中调整类别图像的大小? [英] How to resize the categories images in Magento?
本文介绍了如何在Magento中调整类别图像的大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在Magento中调整类别图像的大小?我使用以下代码调整产品图片的大小,但无法将其用于显示类别图片:
How to resize the categories images in Magento? I used the following code to resize product images, but I'm not able to use it for showing categories images:
$this->helper('catalog/image')->init($_product, 'small_image')->resize(170);
推荐答案
如果我没记错的话,应该是:
If I am not mistaken, it should be :
init($_product, 'small_image')->resize(100,100);
// single parameter work with 'image'
init($_product, 'image')->resize(100);
// How about this
$this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $image->getFile())->resize(100,100);
这是新代码.如果您告诉我使用哪个扩展名之前,我们会很快解决. 如果我没记错的话,您使用了Template Monster Catalog Image Extension.因此,扩展程序内部有一个函数,如下所示.
Here is the new code. If you tell me before which extension used, we were solve quickly. If I am not mistaken, you used Template Monster Catalog Image Extension. So, there is a function inside of the extension, like below.
// app/design/frontend/default/default/template/easycatalogimg/homepage.phtml
<?php echo Mage::helper('easycatalogimg/image')->resize($imageUrl, $width , $height) ?>
这篇关于如何在Magento中调整类别图像的大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文