Magento 1.9:动态 config.xml

Magento 1.9: dynamic config.xml

我正在创建一个 Magento 1.9 模块,到目前为止已经定义了设置(有效),然后我继续为我的设置字段添加默认值。现在,我想知道,是否有可能在 config 中有一个值将链接到其他值?与此一样,我想为值为站点名称或站点描述的字段添加默认设置。

创建 system.xml 并使用下面的示例代码:

<?xml version="1.0"?>
<config>
    <sections>
        <folder translate="label" module="modulename">            
            <groups>
               <site_details>
                    <label>Website discription</label>
                    <frontend_type>text</frontend_type>
                    <sort_order>1</sort_order>
                    <show_in_default>1</show_in_default>
                    <show_in_website>1</show_in_website>
                    <show_in_store>1</show_in_store>
                    <fields>
                        <name translate="label">
                            <label>Site name</label>
                            <frontend_type>text</frontend_type>
                            <sort_order>1</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>1</show_in_store>
                        </name>
                        <description>
                            <label>description</label>
                            <comment><![CDATA[description]]></comment>
                            <frontend_type>textarea</frontend_type>
                            <sort_order>2</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>1</show_in_store>
                        </description>
                    </fields>   
               </site_details>  
            </groups>
        </floder>
      </sections>
</config>