Add a static block to CMS page or PHTML (template) file

Submitted by metaharper - 5 years ago

The first method calls a static block in CMS pages. The second method allows you to call a static block in PHTML files. Additional reference:

// Method 1
{{block type="cms/block" block_id="your-_block_id"}}

// Method 2
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('your_block_id')->toHtml(); ?>
Learn PHP
comments powered by Disqus
Proudly hosted on Digital Ocean