Inside my 1column.phtml I have this piece of code:
<?php echo $this->getChildHtml('wide'); ?>
Inside my app/design/frontend/enterprise/wk/layout/wk.xml I have:
<cms_index_index>
<reference name="wide">
<block type="wk/geotarget" name="geotarget"/>
</reference>
</cms_index_index>
Inide app/code/local/Company/Module/Block/Geotarget.php I have:
class Company_Module_Block_Geotarget extends Mage_Core_Block_Template
{
protected function _toHtml()
{
$layout = Mage::getSingleton('core/layout');
// Generate a CMS block object
$block = $layout->createBlock('cms/block');
// Set the block ID of the static block
$block->setBlockId('homepage-hero');
return parent::_toHtml();
}
}
How do I render this static block based on block ID? I need to do some custom logic inside that Block to get some specific or random block and render it.