By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,913 Members | 1,379 Online
Bytes IT Community
Submit an Article
Got Smarts?
Share your bits of IT knowledge by writing an article on Bytes.

Add Custom tab in system configuration

P: 1
Hello All,

Here, I am explaining you that how to add custom tab in system -> Configuration area.
Well, fist you need an extension that you’re going to build configuration for. If you’re new to Magento and you don’t know how to create an extension of your own, there’s a bunch of articles on this site about that, but my suggestion is to start on fresh extension, for testing.
And now on to the fun stuff. First, you need to add (or edit) your system.xml file.

Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="UTF-8"?> 
  2. <config> 
  3. <tabs> 
  4. <inchoo translate="label" module="mymodule"> 
  5. <label>Inchoo Extensions</label> 
  6. <sort_order>100</sort_order> 
  7. </inchoo> 
  8. </tabs> 
  9. <sections> 
  10. <inchoo translate="label" module="mymodule"> 
  11. <label>Extension Options</label> 
  12. <tab>inchoo</tab> 
  13. <sort_order>1000</sort_order> 
  14. <show_in_default>1</show_in_default> 
  15. <show_in_website>1</show_in_website> 
  16. <show_in_store>1</show_in_store> 
  17. <groups> 
  18. <inchoo_group translate="label" module="mymodule"> 
  19. <label>My Extension Options</label> 
  20. <frontend_type>text</frontend_type> 
  21. <sort_order>1000</sort_order> 
  22. <show_in_default>1</show_in_default> 
  23. <show_in_website>1</show_in_website> 
  24. <show_in_store>1</show_in_store> 
  25. <fields> 
  26. <inchoo_input translate="label"> 
  27. <label>My Input Field: </label> 
  28. <comment>My Comment</comment> 
  29. <frontend_type>text</frontend_type> 
  30. <sort_order>20</sort_order> 
  31. <show_in_default>1</show_in_default> 
  32. <show_in_website>1</show_in_website> 
  33. <show_in_store>1</show_in_store> 
  34. </inchoo_input> 
  35. <inchoo_select translate="label"> 
  36. <label>My Dropdown: </label> 
  37. <comment>Source model provider Magento’s default Yes/No values</comment> 
  38. <frontend_type>select</frontend_type> 
  39. <sort_order>90</sort_order> 
  40. <show_in_default>1</show_in_default> 
  41. <show_in_website>1</show_in_website> 
  42. <show_in_store>1</show_in_store> 
  43. <source_model>adminhtml/system_config_source_yesno</source_model> 
  44. </inchoo_select> 
  45. </fields> 
  46. </inchoo_group> 
  47. </groups> 
  48. </inchoo> 
  49. </sections> 
  50. </config> 
  51.  
Then, in order to use Magento’s configuration section, you need to add (or edit) your extension’s config.xml file, and define models and helpers locations.

Expand|Select|Wrap|Line Numbers
  1. <config> 
  2. <modules> 
  3. <Inchoo_Mymodule> 
  4. <version>0.1.0</version> 
  5. </Inchoo_Mymodule> 
  6. </modules> 
  7. <global> 
  8. <models> 
  9. <mymodule> 
  10. <class>Inchoo_Mymodule_Model</class> 
  11. </mymodule> 
  12. </models> 
  13. <helpers> 
  14. <mymodule> 
  15. <class>Inchoo_Mymodule_Helper</class> 
  16. </mymodule> 
  17. </helpers> 
  18. </global> 
  19. </config> 
  20.  
And finally, you need to edit your extension’s config.xml file again, in order to avoid “Permission denied.” problem.
Insert this part of XML into inside “<config></config>” tags:
Expand|Select|Wrap|Line Numbers
  1. <adminhtml> 
  2. <acl> 
  3. <resources> 
  4. <all> 
  5. <title>Allow Everything</title> 
  6. </all> 
  7. <admin> 
  8. <children> 
  9. <system> 
  10. <children> 
  11. <config> 
  12. <children> 
  13. <inchoo> 
  14. <title>Inchoo - All</title> 
  15. </inchoo> 
  16. </children> 
  17. </config> 
  18. </children> 
  19. </system> 
  20. </children> 
  21. </admin> 
  22. </resources> 
  23. </acl> 
  24. </adminhtml> 
  25.  

And if you’ve done everything correctly you should see in admin panel syatem -> Configuration - >left side Inchoo Extension tab.


- Hope it will help you
Mar 23 '13 #1
Share this Article
Share on Google+
1 Comment


P: 1
I read a solution to adding custom tab in magento on magenticians blog. They have great tutorial their. You should search on this on their website.

the problem might be here

Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="UTF-8"?> 
  2. <config> 
  3. <tabs> 
  4. <inchoo translate="label" module="mymodule"> 
  5. <label>Inchoo Extensions</label> 
  6. <sort_order>100</sort_order> 
  7. </inchoo> 
  8. </tabs> 
  9. <sections> 
  10. <inchoo translate="label" module="mymodule"> 
  11. <label>Extension Options</label> 
  12. <tab>inchoo</tab> 
  13. <sort_order>1000</sort_order> 
  14. <show_in_default>1</show_in_default> 
  15. <show_in_website>1</show_in_website> 
  16. <show_in_store>1</show_in_store> 
  17. <groups> 
  18. <inchoo_group translate="label" module="mymodule"> 
  19. <label>My Extension Options</label> 
  20. <frontend_type>text</frontend_type> 
  21. <sort_order>1000</sort_order> 
  22. <show_in_default>1</show_in_default> 
  23. <show_in_website>1</show_in_website> 
  24. <show_in_store>1</show_in_store> 
  25. <fields> 
  26. <inchoo_input translate="label"> 
  27. <label>My Input Field: </label> 
  28. <comment>My Comment</comment> 
  29. <frontend_type>text</frontend_type> 
  30. <sort_order>20</sort_order> 
  31. <show_in_default>1</show_in_default> 
  32. <show_in_website>1</show_in_website> 
  33. <show_in_store>1</show_in_store> 
  34. </inchoo_input> 
  35. <inchoo_select translate="label"> 
  36. <label>My Dropdown: </label> 
  37. <comment>Source model provider Magento’s default Yes/No values</comment> 
  38. <frontend_type>select</frontend_type> 
  39. <sort_order>90</sort_order> 
  40. <show_in_default>1</show_in_default> 
  41. <show_in_website>1</show_in_website> 
  42. <show_in_store>1</show_in_store> 
  43. <source_model>adminhtml/system_config_source_yesno</source_model> 
  44. </inchoo_select> 
  45. </fields> 
  46. </inchoo_group> 
  47. </groups> 
  48. </inchoo> 
  49. </sections> 
  50. </config> 
May 30 '17 #2

Post your comment

Sign in to post your comment or Sign up for a free account.

Browse more PHP Articles on Bytes