Call Static Block

0 votes
246 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 15 views
0 votes
1 answer 20 views
+1 vote
1 answer 41 views
0 votes
1 answer 74 views
0 votes
1 answer 168 views
asked Dec 16, 2016 in Magento by anonymous
+2 votes
0 answers 120 views
...