Quantcast
Viewing all articles
Browse latest Browse all 15

Adding CMS Static Blocks to Magento Page Layouts

This will be short, but as you know phtml template files in Magento are stitched together using layout XML files. Sometimes we might have the need to include a static block we have created in the backend to one of they layout XML files. Here is the XML snip one would use to evoke the backend static block in a XML layout file.

<block type="cms/block" name="YOUR CMS BLOCK IDENTIFIER">
    <action method="setBlockId"><block_id>YOUR CMS BLOCK IDENTIFIER</block_id></action>
</block>

When you create your static block in Magento’s backend, it will ask you to both give it a name and unique identifier. Replace both instances of “YOUR CMS BLOCK IDENTIFIER” in the above XML code snip with your own static blocks unique identifier name and you should be set.

Thanks!


Viewing all articles
Browse latest Browse all 15

Trending Articles