Home » Magento, XML17 February 2010

Magento: Read config XML nodes

Here, I will be showing you how you can read XML nodes from config.xml file of your module. It’s through the Magento way with Mage::getConfig()->getNode() function. :)

Here is the XML code of my config.xml file. I will be reading the nodes of this XML file.

Here is the code to read the node of the above XML file. Here, ‘catalog/mypage‘ is parent nodes path. It depends upon XML node layout.

Hope this helps. Thanks.


Get New Post by Email

Find me on

FacebookTwitterGoogle+LinkedInRSS Feed
  • Gregc

    Looks like you need to add the default node in as well

    echo Mage::getConfig()->getNode(‘default/catalog/mypage’)->name;