Monday 29 December 2014

Add static block in magento

Add extra blocks in magento: 

Step 1: Create static block login your dashboard
Go to cms/Static Blocks
Step 2: Click on add new Block

Step 3: calling on frontend

Static blocks are very important part in magento for calling different blocks to change your look and feel of magento site

use this code in your template file(.phtml files)
echo $this->getLayout()->createBlock('cms/block')->setBlockId('identifire')->toHtml();
Explanation: 
1.suppose we want to add a banner in our magento store  for 
special offers on sidebar so we can use static block. 
2. If we want to add social media in my magento store in footer 
then we can use static block.
3.if we want to add links in my site then we can use static blocks