top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

How to call a static block/cms page in a Phtml file in magento?

+3 votes
94 views
How to call a static block/cms page in a Phtml file in magento?
posted Oct 26, 2015 by Vrije Mani Upadhyay

Share this question
Facebook Share Button Twitter Share Button Google+ Share Button LinkedIn Share Button Multiple Social Share Button

1 Answer

0 votes

You can easily call any static block from template (phtml) file. At first, you have to create a static block.

Let us suppose, you created a static block with the identifier cool_items.

Now, you can call the static block from any phtml file with the help of following code:

echo $this->getLayout()
          ->createBlock('cms/block')
          ->setBlockId('cool_items')
          ->toHTML();
answer Nov 23, 2015 by Manikandan J
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...