To call a phtml file in a cms page or cms static block:
Example: Suppose you want to call new.phtml file that resides in catalog/product folder, and you know that its corresponding Block file(php file) resides in Catalog/Product folder, then you can use:
{{block class="Magento\Framework\View\Element\Template" template="PackageName_ModuleName::catalog/new.phtml"}}
{{block class="Magento\Framework\View\Element\Template" template="PackageName_ModuleName::your_template.phtml"}}
If you know, where the block file(php file) for your phtml file resides, then you can use it as type.Example: Suppose you want to call new.phtml file that resides in catalog/product folder, and you know that its corresponding Block file(php file) resides in Catalog/Product folder, then you can use:
{{block class="Magento\Framework\View\Element\Template" template="PackageName_ModuleName::catalog/new.phtml"}}
is it Magento 2?
ReplyDeletefor "Call Phtml file on CMS Page" Magento 2 check this
Deletehttp://www.onlinecode.org/call-phtml-file-cms-page-magento2/
Update your title or update your answer!
ReplyDeleteThank you Raji. I have updated my answer. It was posted before Magento 2 stable version launched.
ReplyDelete