I am trying to insert phtml block in home page CMS in Magento 2. But I am seeing the same block code I have added in CMS backend in front end.

{{block type="template" template="page/test.phtml"}}

Please help.

1 Answer 1


You can use Magento\Framework\View\Element\Template class to call phtml files

{{block class="Magento\Framework\View\Element\Template" template="Vendor_Module::myfiles/myfile.phtml"}}

use this code in cms page or static block.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.