Call Static Block

0 votes
276 views
asked Jun 13, 2016 in Magento by Brandon
How can we call a static block directly in Magento?

1 Answer

0 votes
answered Jun 13, 2016 by Kate
You can do this simply by calling this method below.

<?php

echo $this->getLayout()->createBlock('cms/block')->setBlockId('block-name')->toHtml();

?>

You may thank someone else for this, as I have got this from some other article online long before :)

...Kat

Related questions

0 votes
1 answer 689 views
0 votes
1 answer 602 views
+1 vote
1 answer 573 views
0 votes
1 answer 510 views
0 votes
1 answer 542 views
asked Dec 16, 2016 in Magento by anonymous
+2 votes
0 answers 284 views
...