Accessing a Magento Static Block From a .phtml Template File
<?php
// Retrieve the layout object
$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('block-id-in-magento');
// Write the static block content to screen
echo $block->toHtml();
?>Written by Wayne Roddy
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Magento
Authors
Did you know?
Magento checkout pages are a common target for Magecart-style card skimming. Payment, analytics, and extension scripts on those pages need an inventory and a watch for silent changes.
Security insights from Cside
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#