Magento 1.7 – How to Add System Configuration Variable Value in Custom Variable

configurationmagento-1.7

I have added a custom field- Fax number on System > Configuration > General > Store information. I need to use this variable value in my cms page.
There are system variables which we can use in our cms blocks like {{store_name}}, {{store_email}}.
I want to use my fax number as a variable. Something like {{store_fax_number}}
I have tried creating custom variable but don't know how to add a configuration field value to that variable.
I know I can add directly my fax number to a custom variable. But I don't want to do that. I want to add a field in store information and then use that value in custom variable.
If anyone have any idea please help.

Best Answer

I found the solution.
To use a custom field value in cms block, you can use the below code.
I added a new field named fax in system.xml file located at local/Mage/Core/etc/ the code for adding the field is,

<config>
......
<general translate="label" module="core">
......
<groups>
......
<store_information translate="label">
......
    <fax translate="label">
       <label>Store Fax Number</label>
       <frontend_type>text</frontend_type>
       <sort_order>22</sort_order>
       <show_in_default>1</show_in_default>
       <show_in_website>1</show_in_website>
       <show_in_store>1</show_in_store>
    </fax>
......
</store_information>
......
</groups>
......
</general>
......
</config>

Now to use this variable value in your cms block you just need to add below code

{{config path="general/store_information/fax"}}

here fax is the name of your field.