I have this static block which appears in navigation bar if enabled. I want it to appear only when it’s enabled for selected store view (and remains disabled on other store views).
My thought is just to check whether it’s active and enabled in current store view, but I can’t find documentation or tutorial that points to it.
Any ideas or references I can use?
<?php $custom_tab = Mage::getModel('cms/block')->load('vista_navigation_block');
if($custom_tab->getIsActive()) {
echo '
<li class="nav-custom-link level0 level-top parent">
<a href="#" class="level-top">
<span>'.$custom_tab->getTitle().'</span>
</a>
<div class="level0-wrapper" style="left: 0px; display: none;"><div class="header-nav-dropdown-wrapper clearer">'.$this->getLayout()->createBlock('cms/block')->setBlockId('vista_navigation_block')->toHtml().'</div></div>
</li>';
} ?>
</ul> <!--nav-->
<?php endif; ?>
Try the below code,