Calling static blocks from anywhere in Magento
Magento eCommerce gives us the power to add our own snippets of html wherever we wish. Magento calls these snippets ‘static blocks’. To create a new block go to CMS > Static Blocks at the top right of this list click ‘Add New Block’.
Enter your title and unique identifier e.g. ‘top-advert’. Set the block to enabled and enter the content of the block into the WYSIWYG editor. This is all you need to do Magento side. To call the block onto the frontend of the website open up your template file. For example if I want to call my advert into my product listing I would open:
I want my advert to appear above the product list so I find the opening html for the products list and put this before it:
Thats it, everything you need to know 🙂
Want to discuss a project?
Talk to our Magento experts on 01785 279920