By default, Magento allows you to use ifconfig in the following way:
<?xml version="1.0"?> <action ifconfig="path/to/config/status/enabled" method="addItem"> <type>skin_js</type> <name>js/script_one.js</name> </action>
the javascript js/script_one.js will be included if path/to/config/status/enabled is true. Unfortunately, Magento does not allow you to use the "else" block for ifconfig.
for example: Let's say, you want to implement the following logic: if path/to/config/status/enabled is true then include the javacript js/script_one.js else include the javacript js/script_two.js Thanks to Extended ifconfig extension by CODNITIVE it is now possible to use more conditions by following the syntax below:
<?xml version="1.0"?> <layoutupdate> <catalog_product_view> <reference name="head"> <action method="addItem" ifconfig="path/to/config/status/enabled" condition="1"> <type>skin_js </type> <name>js/script_one.js </name> </action> <action method="addItem" ifconfig="path/to/config/status/enabled" condition="0"> <type>skin_js </type> <name>js/script_two.js </name> </action> </reference> </catalog_product_view> </layoutupdate>