First create a blank module with following files
etc/modules/Bd_Systemconfigdemo.xml
Bd/Systemconfigdemo/etc/config.xml
Then create a system.xml file in Bd/Systemconfigdemo/etc/system.xml with following code
<?xml version="1.0"?>
<config>
<tabs>
<demo_tab translate="label" module="systemconfigdemo">
<label>Demo Tab</label>
<sort_order>0</sort_order>
</demo_tab>
</tabs>
<sections>
<demo_section translate="label" module="systemconfigdemo">
<label>Demo Section</label>
<tab>demo_tab</tab>
<frontend_type>text</frontend_type>
<sort_order>0</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<groups>
<demo_group translate="label">
<label>Demo Group</label>
<frontend_type>text</frontend_type>
<sort_order>0</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<fields>
<demo_field1 translate="label">
<label>Demo Field1</label>
<frontend_type>text</frontend_type>
<sort_order>0</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment>first</comment>
</demo_field1>
<demo_field2 translate="label">
<label>Demo Field2</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_yesno</source_model>
<sort_order>0</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment>second</comment>
</demo_field2>
</fields>
</demo_group>
</groups>
</demo_section>
</sections>
</config>
And adminhtml.xml with following code
<?xml version="1.0"?>
<config>
<acl>
<resources>
<admin>
<children>
<system>
<children>
<config>
<children>
<demo_section translate="title" module="systemconfigdemo">
<title>Demo Section Section</title>
<sort_order>0</sort_order>
</demo_section>
</children>
</config>
</children>
</system>
</children>
</admin>
</resources>
</acl>
</config>
etc/modules/Bd_Systemconfigdemo.xml
Bd/Systemconfigdemo/etc/config.xml
Then create a system.xml file in Bd/Systemconfigdemo/etc/system.xml with following code
<?xml version="1.0"?>
<config>
<tabs>
<demo_tab translate="label" module="systemconfigdemo">
<label>Demo Tab</label>
<sort_order>0</sort_order>
</demo_tab>
</tabs>
<sections>
<demo_section translate="label" module="systemconfigdemo">
<label>Demo Section</label>
<tab>demo_tab</tab>
<frontend_type>text</frontend_type>
<sort_order>0</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<groups>
<demo_group translate="label">
<label>Demo Group</label>
<frontend_type>text</frontend_type>
<sort_order>0</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<fields>
<demo_field1 translate="label">
<label>Demo Field1</label>
<frontend_type>text</frontend_type>
<sort_order>0</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment>first</comment>
</demo_field1>
<demo_field2 translate="label">
<label>Demo Field2</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_yesno</source_model>
<sort_order>0</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment>second</comment>
</demo_field2>
</fields>
</demo_group>
</groups>
</demo_section>
</sections>
</config>
And adminhtml.xml with following code
<?xml version="1.0"?>
<config>
<acl>
<resources>
<admin>
<children>
<system>
<children>
<config>
<children>
<demo_section translate="title" module="systemconfigdemo">
<title>Demo Section Section</title>
<sort_order>0</sort_order>
</demo_section>
</children>
</config>
</children>
</system>
</children>
</admin>
</resources>
</acl>
</config>
No comments:
Post a Comment