Adding a static block to a Magento template
Sometimes, you may need to add an editable block to your template to allow content to be easily updated through Magento's administration panel. Magento's static blocks allow you to do this, and they can be embedded in the Magento templates.
Creating a new static block
Firstly, you will need to create a static block in Magento. Log in to your store's administration panel and navigate to CMS | Static Blocks, as shown in the following screenshot:
Here, click on the Add New Block button at the top-right of your screen, as shown in the following screenshot:
You can create your block here: the block Title field allows you to give your block a name, while the Identifier field is a machine-readable way to identify this specific block (remember this value, as you'll need it soon!).
Tip
Note that the value of the Identifier field cannot contain spaces or special characters, and it's typical to use an underscore character (_
) here to separate...