Wednesday, October 3, 2012

How to get a html output through xml in Magento


>> Basically we use to get the content page like :

         <reference name="content">
            <block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml" />
        </reference>

  It'll return html output with header, footer content. If you want to get only the content of list.phtml
Then you have to modify the code with following:

        <block type="core/text_list" name="root" output="toHtml">
              <block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml" />
        </block>




The above code will return only the content of list.phtml.