Posted By

cpres on 06/15/12


Tagged

cms magento


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

WGenie


Get HTML from Magento CMS Block


 / Published in: PHP
 

Adding HTML into custom blocks rather than hard coding makes it so people don't bother us devs to change sheite!

  1. <?php
  2. $layout = $this->getLayout();
  3.  
  4. if (!$layout ) {
  5. $layout = Mage::app()->getLayout();
  6. }
  7.  
  8. echo $layout->createBlock('cms/block')->setBlockId('whatever_custom_id')->toHtml();
  9.  
  10. ?>

Report this snippet  

You need to login to post a comment.