Friday, October 4, 2013

Magento page.xml changes not getting reflected

Recently I was trying to include a small JS snippet in footer. I created another block for this and tried to put in page.xml.



inside footer block I added my custom intercom block -
 <block type="page/html_footer" name="footer" as="footer" template="page/html/footer.phtml">
<block type="page/html_intercom" name="intercom" as="intercom"  template="page/html/intercom.phtml"  />
....
...
</block>

But the changes didn't reflect on frontend. Ohhh did I clean cache ?  Yes I did , twice thrice still no changes on frontend. After struggling for couple of hours I came to know that teh page.xml file was not even getting used. Magento theme (dresscode theme) has created another file local.xml adjacent to page.xml.
I had to do my changes in local.xml file

<default>
  <layout>
....
...

     <reference name="footer">
            <block type="core/template" name="intercom" as="intercom" template="page/html/intercom.phtml"/>
      </reference>

...
....
   </layout>
  </default>

Some times Magento themes create local.xml  in app\design\frontend\default\theme-name\layout\
and uses it in place of page.xml.
Beware of this :)

1 comment:

  1. Absolutely fantastic topic! Great blog. Thanks for taking the time and writing this.

    Magentocommerce - Magento Development

    ReplyDelete