How to call Magento block in phtml template?

后端 未结 5 1193
温柔的废话
温柔的废话 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:24

    You can call a statick block like:

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

    And call a block like:

    getLayout()->createBlock('sidebar/left')->setTemplate('bannerslider/left.phtml')->tohtml(); ?>
    

    Visit magevn.com to see more usecase to use block in magento.

提交回复
热议问题