Reputation: 11474
I am customizing the home page and i want to add two static blocks (actually 2 Images) to it, One at The Top and one at bottom.. While I was navigating through CMS/Static Blocks, I realized I can Only add One Static Block to any page. I couldn't find anything where i can add 2 or more static blocks. Is there a way i can add two or more such static blocks in a single page..
Upvotes: 0
Views: 1559
Reputation: 41
Use this code in the template file (phtml file) where you want your blocks to be displayed.
For first block,
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('block1_identifier')->toHtml() ?>
then for second block,
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('block2_identifier')->toHtml() ?>
Upvotes: 0
Reputation: 1498
Sure.
go to CMS > Static Blocks and create two new blocks with your images, remember the identifier
go to CMS > Pages and select the cms page where you want to place your images
open the cms page and and put the following in the editor, where you want to appear your images: {{block type="cms/block" block_id="IDENTIFIER"}}
If you want to put your images on other pages than cms pages you need to modify the specific layout file. A good point to start with this: http://magebase.com/magento-tutorials/demystifying-magentos-layout-xml-part-1/
Hope this helps!
Upvotes: 1