Add Static Block content in template

by Roy Andre on June 18, 2009

Normally you would need to add some lines of code in the XML layout files to be able to include a static block from the CMS-system in the Magento Backend, but using this code in the template will automatically fetch the content from the static block:


<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('your_cms_block_identifier')->toHtml() ?>

Popularity: 7% [?]

Leave a Comment

Previous post: Magento and Drupal

Next post: Display best selling product in magento