Magento 1.4 - how to show html on product view?

Posted by Sam on Stack Overflow See other posts from Stack Overflow or by Sam
Published on 2010-03-19T23:03:39Z Indexed on 2010/03/19 23:11 UTC
Read the original article Hit count: 267

Filed under:

Hi All

The new version of Magento, 1.4, has it's own WYSIWYG editor, which can be enabled for any product attribute. However, if it is enabled, say for the additional info attribute, if you view the product page the html will be escaped, so you see all the tags (< p >, < ul > etc).

If you change the following in template/catalog/product/view.phtml, you can get the "Quick Overview" and "Additional Information" sections to correctly show the html:

<?php echo nl2br($this->htmlEscape($_product->getShortDescription())) ?> 

to

<?php echo $_product->getShortDescription() ?>

However, the additional info section is added via template/catalog/product/view/attributes.phtml using the following line, and I can't figure out how to get it to show the html correctly:

<?php echo $_helper->productAttribute($_product, $_data['value'], $_data['code']) ?>

This references Mage_Catalog_Block_Product_View_Attributes, and if I go to that file and change the following, it works:

$value = $this->htmlEscape($value);

to

$value = value;

But is there anyway to do this without overiding this core file with a local version?

© Stack Overflow or respective owner

Related posts about magento