Wednesday, June 22, 2011

How to show static block only on home page in magento



<?php    $ref = new Mage_Page_Block_Html_Header();   if($ref->getIsHomePage()){ ?>   <div class="homepage"><?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('Your_StaticBlock_Id')->toHtml();?></div>   <?php   }   ?>
enjoy...........

No comments:

Post a Comment