>> You can display a static block in a category page by Managing the category from admin.
But if you want the block in a custom page for that category. You use the following code:
// load the category
$_category = Mage::getModel('catalog/category')->load($categoryId);
// Fetching the block data
$html = $this->getLayout()->createBlock('cms/block')
->setBlockId($_category->getLandingPage())
->toHtml();
echo $html;
$_category = Mage::getModel('catalog/category')->load($categoryId);
// Fetching the block data
$html = $this->getLayout()->createBlock('cms/block')
->setBlockId($_category->getLandingPage())
->toHtml();
echo $html;
No comments:
Post a Comment