Skip to main content

E-commerce Platforms

E-commerce Platforms

Display PHTML file or Static Block in CMS page Magento2

Yo display phtml file in CMS page put this line


{{block class="Magento\Framework\View\Element\Template" name="test_block" template="{Vendor}_{Module}::test_block.phtml"}}

the same way in XML layout file you can use 

<block class="Magento\Framework\View\Element\Template" name="test_block" template="{Vendor}_{Module}::test_block.phtml"/>

if you want to put it in phtml file