Skip to main content

Magento2

Power your online business with the most flexible and scalable ecommerce platform

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