Sunday 20 March 2016

Magento : Get CMS Static Block Model Data (Title, Status, Content)

You can store template and HTML data in Magento’s static blocks. If you want to pull it into your PHTML templates, just call load up the model and use the data fields.

<?php
$staticBlock = Mage::getModel('cms/block')->load('static-block-identifier');
echo $staticBlock->getTitle();
echo $staticBlock->getIdentifier();
echo $staticBlock->getIsActive();
echo $staticBlock->getContent();

?>

No comments:

Post a Comment