There is no built in way to do that, mainly because the ifconfig
constraint is used for the current store. When calling Mage::getStroreConfig()
with only one parameter the current store is used as the second parameter. and the layout is loaded for the current store.
But if you insist, here is a possible idea on how to do it.
The action
tags in the layout are parsed and applied in this method Mage_Core_Model_Layout::_generateAction()
. This piece of code checks the ifconfig
attribute.
if (isset($node['ifconfig']) && ($configPath = (string)$node['ifconfig'])) {
if (!Mage::getStoreConfigFlag($configPath)) {
return $this;
}
}
You can override this method to allow an additional parameter for the store. So your xml code would look like this:
<action method="someMethod" ifconfig="some/config/path" store="2" />
Now change the code above that calls the action to this:
if (isset($node['ifconfig']) && ($configPath = (string)$node['ifconfig'])) {
if (isset($node['store'])){//check config setting for supplied store
if (!Mage::getStoreConfigFlag($configPath, $node['store'])) {
return $this;
}
}
else{//default behavior
if (!Mage::getStoreConfigFlag($configPath)) {
return $this;
}
}
}