I have created a file called "myblock.phtml" in frontend\default\default\layout\mytemplate
.It simply displays a "check " button which in turns calls a custom module's controller url.The question is,I want to stop displaying that button(i.e;the myblock.html template )
whenever that custom module is disabled since it doesnt make sense without the enabling the module.Any way to tweak within the module's config.xml??
How to disable custom layouts in magento based on a custom module state?
927 views Asked by PraveenMax At
3
There are 3 answers
3
On
To expand on Anton's answer, create a custom block class that does something like this:
class Mypackage_Myextension_Block_Checkbox extends Mage_Core_Block_Template {
protected function _toHtml() {
if(!$this->checkIfModuleIsEnabled()) {
return "";
}
return parent::_toHtml();
}
}
Hope that helps!
Thanks, Joe
//This is the code in my module's block "Checkbox.php" .Just might be useful for others..
Thus,when i disable the module (System->Advanced->Disable Module),the block contents is not shown.