Tag: parse html

  • Process product attribute HTML values in Magento using template processor

    Process product attribute HTML values in Magento using template processor

    In case you are wondering how to parse HTML content of product attributes here is how:

    // load product model resource
    $productResource = Mage::getSingleton('catalog/product')->getResource();
      
    // load HTML product attribute content and process using CMS template processor
    $helper = Mage::helper('cms');
    $processor = $helper->getPageTemplateProcessor();
    $attributeContent = $processor->filter(Mage::registry('current_product')->getSomeAttributeByCode());
    

    Using this approach you can of course process CMS block template placeholders too.