1

I am finding a way to call my custom created phtml file in Cms page. The file is located in Magento_catalog > product > bestseller.phtml, And the way which I am trying is -

{{block class="Magento\Framework\View\Element\Template" name="test_file" template="Magento_catalog::product/bestseller.phtml"}}

{{block class="Magento\Catalog\Block\Product\View\Description" template="Magento_Catalog::product\bestseller.phtml"}}

But the file is not loading in Cms page. Please help me to do it.

Thanks

2
  • bestseller.phtml is your custom phtml? Mar 28 '17 at 13:42
  • Yes its my custom created phtml file...
    – Yudi
    Mar 28 '17 at 14:11
0

In first syntax, you did not capitalise the "C" in Magento_catalog .Correct syntax is below

{{block class="Magento\Framework\View\Element\Template" name="test_file" template="Magento_Catalog::product/bestseller.phtml"}}

in second syntax, you can not use product description block in cms page. Because it required product in registry so you can only use it on product detail page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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