I wanted to move the
product.info.media block from the
catalog.xml in the left column for all product view.
To achive this, i have added two lines to my
<catalog_product_view> <reference name="left"> <block type="catalog/product_view_media" name="product.info.media" as="media" template="catalog/product/view/media.phtml"/> </reference> <reference name="product.info"> <action method="unsetChild"><child>media</child></action> </reference> </catalog_product_view>
The media.phtml is binary identical with the default file from the 126.96.36.199 version of magento.
The strange thing is, that the product image on the webpage has this code:
<img id="image" src="path/to/image.jpg" alt="" title="" style="position: relative; left: 0px; width: 220px; top: 215px;">
Why is there a style defined for top?! As this style is defined inside the element i can't even change it with css. Could anyone explain this behaviour of magento?
The lines in the media.phtml which are creating this look like this:
$_img = '<img id="image" src="'.$this->helper('catalog/image')->init($_product, 'image').'" alt="'.$this->htmlEscape($this->getImageLabel()).'" title="'.$this->htmlEscape($this->getImageLabel()).'" />'; echo $_helper->productAttribute($_product, $_img, 'image');
They lead me to
app/code/core/Mage/Catalog/Helper/Output.php where the productAttribute function is defined. But why for heavens sake is the top style set? It makes no sense at all. If i wanted to set it i would use css.
Thanks in advance.