Call Static Block

0 votes
294 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 1356 views
0 votes
1 answer 1201 views
+1 vote
1 answer 1237 views
0 votes
1 answer 721 views
asked Feb 14, 2017 in Magento by Toms
0 votes
1 answer 747 views
asked Dec 16, 2016 in Magento by anonymous
+2 votes
0 answers 339 views
...