Fixing Magento Attribute Rendering Issues

by Michael Lyman on February 18, 2009

Last night I upgraded my store to the latest version of Magento, version 1.2.1. Things went very smoothly, in part because of a few precautions I’ve begun to take during all Magento updates. First, because it can cause problems during the upgrade, I now redirect all web traffic to a maintenance page while performing the procedure since problems can occur otherwise arise.  Another item I’ve made a standard practice during Magento upgrades is to delete the var/sessions and var/cache folders – whether Magento recommends it or not.

HTML Code displayed on Magento Front end

HTML Code displayed on Magento Front end

The only post-upgrade problem I encountered  was that three custom product attributes would not render properly when viewing product pages.  I’d previously created the three attributes in Magento – ASL signs, special features, and preview – to display additional product information about the product to my customers.  For example, the Preview attribute is used to provide video or audio previews for some of our DVD or CD products. After the upgrade, instead of rendering the HTML code, as it had always done,  Magento was instead displaying them as regular text.

I searched the Magento forums and found a thread with a work around that fixed the html by altering the core code. Unfortunately, changing the core code is a very poor practice because with every update it will get overwritten and you’ll find yourself repairing the same bugs over and over again. So I chose not to take this route and dug a little further into the problem.

According to the Magento update logs, the error I encountered was supposed to have been fixed with the upgrade to 1.2.1 that I’d applied. After the upgrade, however,  the issue still remained. The solution turned out to be  a simple change in the configurations of the three custom attributes I’d previously defined.

Attribute Configurations in Magento

Attribute Configurations in Magento

To fix this problem, login to Magento admin and go to Catalog > Attributes > Manage Attributes. Find the problem attribute with the html code issue and open edit it. Scroll to the bottom of the list of configurations and you’ll find a setting titled “Allow HTML-tags on Front-end.”  In my case, the three attributes that I’d created had this setting set to “No.” The fix was to simply change it to “Yes,” on all three and save the chagnes. The html code issue disappeared immediately.

Share and Enjoy:
  • del.icio.us
  • Digg
  • Google Bookmarks
  • Slashdot
  • Technorati
  • E-mail this story to a friend!
  • StumbleUpon
  • TwitThis

{ 1 comment… read it below or add one }

Mark 03.27.09 at 3:21 pm

I’m new to Magento. We set up a free shipping attribute and want to display a free shipping image on the category and product pages for those products that have free shipping. I’m thinking that I probably have to enable “Allow HTML-tags on Front-end”, but its grayed out and un-settable.

I’ve noticed that Custom Layout Update “Allow HTML-tags on Front-end” is settable, but I haven’t figured out the difference.

Any ideas?

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>