0
votes

I have follow instruction as per magento U, configuration XML. but XML configuration is not working from my side.

Here is code which i have done.

app/etc/First_Module.xml

<?xml version="1.0"?>

    <config>
        <modules>
            <First_Module>
                <active>true</active>
                <codePool>local</codePool>
            </First_Module>
        </modules>
    </config>

in local codePool

First/Module/etc/config.xml

<?xml version="1.0"?>
<config>
    <default>
        <some>
            <ranadom>
                <xpath>Here is value</xpath>
            </ranadom>
        </some>
    </default>
</config>

Now, I want to call xpath value in cmsController indexAction()

For that I have put code in cms/contollers/indexAction()

 echo "test";
 echo Mage::getStoreConfig('some/random/xpath');
 die;

With help of echo Mage::getStoreConfig('some/random/xpath'); i am call value of xpath Tag.

when my cms indexAction() will call at that time. I can see Here is value.

Can any one tell where i am wrong?

3
in config.xml you use 'ranadom' but then call the config value using 'random'. Just a typo? - Jonathan Hussey
Thank you Jonathan Hussey, In my config.xml you have a typo. - Nikunj K.

3 Answers

1
votes

In your config.xml you have a typo. You wrote <ranadom> instead of <random>.

1
votes
  • Your config.xml code just saves the default value of some/ranadom/path xpath and it doesn't insert the value in database. Please check in your database table core_config_data if you have the row with path some/ranadom/path. If you don't have, create a system.xml file and put the declaration of some/ranadom/path xpath there, it will make insert to your core_config_data table.

  • Put your module declaration in your config.xml file.

  • You are getting the value by Mage::getStoreConfig('some/RANDOM/xpath');, while in your config.xml it's RANADOM

  • Did you clear the cache to reflect these changes?

0
votes

Go to system->cache management and check all items and disabled them. Then you need not flush your cache every time and you get the output dynamically just refreshing the web page.