Skip to content

Instantly share code, notes, and snippets.

@cfaria
Created September 3, 2013 14:42
Show Gist options
  • Save cfaria/6424869 to your computer and use it in GitHub Desktop.
Save cfaria/6424869 to your computer and use it in GitHub Desktop.
Show static block in template. Magento
<?php
//Check if block is active
$empty_category_block = Mage::getModel('cms/block')->load('block_id');
if($empty_category_block->getIsActive()) :
echo $this->getLayout()->createBlock('cms/block')->setBlockId('block_id'.$catid)->toHtml();
endif;
?>
<?php
//Show static block by widget filter
$filter = new Mage_Widget_Model_Template_Filter();
$_widget = $filter->filter('{{widget type="cms/widget_page_link" template="cms/widget/link/link_block.phtml" page_id="2"}}');
echo $_widget;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment