Posted By

alexmargineanu on 02/10/11


Tagged

block cms Blocks static magento z-block zblock


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

zeljkoprsa
smonteru


Magento - cms/static blocks


 / Published in: PHP
 

  1. Load block in template file
  2.  
  3. <?php
  4. $blockID = 'myblock-identifier';
  5. $block = $this->getLayout()->createBlock('cms/block')->setBlockId($blockID)->toHtml();
  6. ?>
  7.  
  8.  
  9. Load block in XML
  10.  
  11. <reference name="left">
  12. <block type="cms/block" name="sample_block">
  13. <action method="setBlockId"><block_id>sample_block</block_id></action>
  14. </block>
  15. </reference>
  16.  
  17.  
  18.  
  19. Load block in CMS
  20.  
  21. {{block type="cms/block" block_id="my_block" template="cms/content.phtml"}}

Report this snippet  

You need to login to post a comment.