magento - Check Static Block Is Active on Store View -
i have static block appears in navigation bar if enabled. want appear when it’s enabled selected store view (and remains disabled on other store views).
my thought check whether it’s active , enabled in current store view, can’t find documentation or tutorial points it.
any ideas or references 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 below code,
$storeid = mage::app()->getstore()->getid(); $identifiername = 'identifier-name'; $staticblock= mage::getmodel('cms/block')->getcollection()->addstorefilter($storeid)->addfieldtofilter('identifier',array('like'=>$identifiername))->getfirstitem(); $isactive = $staticblock->getisactive()
Comments
Post a Comment