How to call Magento block in phtml template?

后端 未结 5 1132
温柔的废话
温柔的废话 2021-02-04 12:58

i need to display some more links in footer. i created those links in magento admin as static blocks (id = sample_links ).

and then i added following code page.xml file<

5条回答
  •  佛祖请我去吃肉
    2021-02-04 13:26

    If you don't want to bother with XML, same as swapnesh's answer, I'm just making it clearer for the php noobs out there (like me)

    getLayout()->createBlock('cms/block')->setBlockId('your_identifier')->toHtml() ?>
    

    your_identifier is the code you decide to use when creating your block in CMS > Blocks > Create New Block, second line called "Identifier"

提交回复
热议问题