protected function _toHtml() { if (self::$_helper->getEnabled()) { $parent = $this->getParentBlock(); if (!$parent) { return null; } $showLeft = Mage::getStoreConfig('blog/menu/left'); $showRight = Mage::getStoreConfig('blog/menu/right'); $isBlogPage = Mage::app()->getRequest()->getModuleName() == Magiccart_Blog_Helper_Data::DEFAULT_ROOT; $leftAllowed = $isBlogPage && $showLeft == 2 || $showLeft == 1; $rightAllowed = $isBlogPage && $showRight == 2 || $showRight == 1; if (!$leftAllowed && $parent->getNameInLayout() == 'left') { return null; } if (!$rightAllowed && $parent->getNameInLayout() == 'right') { return null; } return parent::_toHtml(); } }