Author - Robert Popovic

I launched Magebase in April, 2010 and am its editor and contributor. My main topics of interest are Magento development, customization and how to get the most out of Magento with the least amount of headache.

More Info » Follow me on Twitter »

Reader Comments (7)

  1. Damián
    September 5, 2011 at 5:14 pm /

    Why not to use instead?

  2. Damián
    September 5, 2011 at 5:16 pm /

    Last chance and no more coffee.
    You can use the depends node into the system.xml.

  3. MagePsycho
    September 5, 2011 at 5:58 pm /



    allows you specify that your configuration field should only be displayed when another confgiruation field in the same group has a specific value.
    But note that this node is available on Magento version >= 1.4.x

  4. Steve
    December 7, 2011 at 8:58 am /

    Simple dependencies can be done anywhere in forms by hijacking the same block that the system.xml config uses. Just add the Mage_Adminhtml_Widget_Form_Element_Dependence block to your layout and use its addFieldMap() to map element IDs to a field and addFieldDependence() to set up the dependencies. For example, on a form that shows FTP login information fields only if FTP is selected as a source, I do:

    	->addFieldMap('source_type', 'source_type')
    	->addFieldMap('ftp_server', 'ftp_server')
    	->addFieldMap('ftp_user', 'ftp_user')
    	->addFieldMap('ftp_pass', 'ftp_pass')
    	->addFieldDependence('ftp_server', 'source_type', 'ftp')
    	->addFieldDependence('ftp_user', 'source_type', 'ftp')
    	->addFieldDependence('ftp_pass', 'source_type', 'ftp');

Add a Comment & Join the Discussion

Insert small snippets of code by using [code]{your_code_here}[/code]
For larger code blocks please use and paste your link.

You may also use the following HTML in your comment: <a href="" title=""> <abbr title="">
<acronym title=""> <blockquote cite=""> <cite> <em> <strike> <strong>


This site uses Akismet to reduce spam. Learn how your comment data is processed.