I am new to magento and I am trying to create a static block for home, category and other pages. I want the static block to appear just above the footer link. And is there a good line tutorial that can provide a good overview of static blocks. How to use them in CMS and how we can generate them using PHP code.
Adding static and non-static blocks directly to templates:
<?php echo $this->getLayout() ->createBlock('cms/block') ->setBlockId('your_block_id')->toHtml(); ?>
Short code inside another block page or cms:
{{block type="cms/block" block_id="your_block_id"}}
For reference, visit here.
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('block_id')->toHtml(); // toy can use this code in your template file. ?>
cms, ,
{{block type="cms/block" block_id="your_block_id"}} // used in your cms pages like a short code
.phtml:
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('static_block_id')-toHtml(); ?>
CMS:
{{block type="cms/block" block_id="my_block" template="cms/content.phtml"}}