Call Static Block

0 votes
311 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

+1 vote
2 answers 1011 views
+1 vote
1 answer 944 views
0 votes
1 answer 3679 views
0 votes
1 answer 3251 views
+1 vote
1 answer 2414 views
0 votes
1 answer 926 views
asked Feb 14, 2017 in Magento by Toms
...