I’m working on a module in which we have a configuration as “advanemenu/general/enabled”
By using this config I am being able to add items conditionally to my magento frontend.
Ex.
<reference name="head">
<action method="addItem" ifconfig="advancemenu/general/enabled"><type>skin_css</type><name>css/advancemenu.css</name></action>
</reference>
Now similarly I want to remove the top navigation if the config value is enabled.
I tried the following but without any result…
<remove ifconfig="advancemenu/general/enabled" name="catalog.topnav" />
Incase the ifconfig works with <action> then is there any way to remove top navigation using this method.
Please help me if anyone knows how to do this.
(Thnx in Advance)
IfConfig only work with action method. When you call action in a xml layout this parse in a call to funcion in the block instance.
you can see this in:
file: app/code/core/Mage/core/Model/layout.php around line 289
but a posible solution for this is add a template only in case of true value. For example
then, only when you have enable your module, you have template associate to this block, in another case, your block don´t have template, then don´t load.