Magento: Add Custom Module For Custom Admin Config Options

In my previous post, I showed you how to add instructions to the Short Description on the product add/edit form. While this is useful, if you ever wanted to change the instructions, you would have to open the template file and edit it manually. Wouldn’t it be nice to edit those instructions right in the admin configuration options? Yes, it would!

It’s quite simple to do – and it should only take you a few minutes to implement this. But, the options are endless. You can add all sorts of custom configurable options that you can edit in the admin panel very easily.

To get started, you’ll want to create a new module XML file similar to this: /app/etc/modules/MyMods_All.xml. Put the following code in that file:

<?xml version="1.0"?>

When you have saved that file, create the directory structure for your new module like this:

  • /app/code/local/MyMods/ExtraConfig/
  • /app/code/local/MyMods/ExtraConfig/etc/

Now, create this file: /app/code/local/MyMods/ExtraConfig/etc/config.xml and put the following code within it:

<?xml version="1.0"?>
            <!-- no dependencies -->
		<models />
	    <resources />
	    <extraconfig />
	    <blocks />

Next, create this file: /app/code/local/MyMods/ExtraConfig/etc/system.xml and put the following code within it:

                <backend translate="label">
                        <short_desc_instructions translate="label">
			    <label>Short Description Instructions</label>

When you have all of that done, login to the admin of your site. Browse to System->Configuration and on the left at the bottom, click on “Advanced”. You should see your new module on this list. Then, click on “Catalog” on the left, and you should see your new “Backend” configuration there. Populate that field with the instructions, and save it.

Now, open your elements.phtml file that you edited from the previous post (or open ANY template file that you want this information displayed). Remove the instructions, and replace them with this:

<?php echo Mage::getStoreConfig('catalog/backend/short_desc_instructions') ?>

Once that is done – you should be all set! That’s all there is to it. No database work necessary – Magento covers all that for you. If you want a better look at how to setup the system.xml file, there are loads of examples right before your eyes. Simply go into any of Magento’s core modules (/app/code/core/Mage/) and open up their etc/system.xml file and have a look. You’ll easily figure out how to create different elements and how and where you can place them in different areas throughout the admin section.

Again, let me know if you have any questions, troubles, or better ways to accomplish doing something like this. Enjoy!

This entry was posted in Magento. Bookmark the permalink.

12 Responses to Magento: Add Custom Module For Custom Admin Config Options

  1. Inwing says:

    work great in Magento ver. too.

  2. Naleen Subedi says:

    Thanks for this post!! works GREAT

  3. Syntax3rror says:


  4. Pritesh says:

    Thanks !! Great Post !!!
    can you help me to add drop-down field having my custom (Auto, Manual) value for my module?

    Thanks in advance,
    Pritesh Modi

  5. sandip says:

    I cannot foud any Backend under catalog.Please need somhelp.

  6. Pingback: Variables et conditions utiles sous Magento - Frédéric Martinez

  7. Raj says:

    Great Tutorial Mate!
    But can you please describe little bit more if we want to add a big module in Administration!
    Actually i am building this website and need to add new module within its front end and back end!
    Any help would be appreciated!


  8. jara says:

    Thankyou very much, i gotit….

  9. Vijay Thummar says:

    Thanks a lot. It saved my time.

    Vijay Thummar

  10. deXXmd says:

    Great tutorial!

    Just a thing – where does Magento store the short_desc_instructions attribute??

  11. sincerely yours says:

    Thx for your time ! It helped me

  12. Pingback: Anton » Blog Archive » Bookmarks for February 10th