PHTML file is located in Magento_Theme/templates/html/breadcrumbs.phtml.

I tried with the code

{{block class="Magento\Framework\View\Element\Template" template="Magento_Theme::html\breadcrumbs.phtml"}}

but it is giving error

enter image description here


There is a typo in your template path

it should be:

{{block class="Magento\Framework\View\Element\Template" template="Magento_Theme::html/breadcrumbs.phtml"}}

Note: Use forward slash /

  • still showing the same error. i added the template to the block and called through widget "after the page header top". Jul 1 at 3:13
  • You need to enable developer mode to see exact error OR check in log files
    – Pawan
    Jul 1 at 3:26
  • May be you need to flush cache as well!
    – Pawan
    Jul 1 at 3:42

Custom file path


calling in xml layout file

<block class=""Magento\Framework\View\Element\Template"" name=""test_file"" template=""Magento_Theme::html/test.phtml""/>

Calling in blocks and cms pages

{{block class=""Magento\Framework\View\Element\Template"" name=""test_file"" template=""Magento_Theme::html/test.phtml""}}

Calling in any phtml file

<?php include ($block->getTemplateFile('Magento_Theme::html/test.phtml')) ?>

OR, as before

<?php echo $this->getLayout()->createBlock(""Magento\Framework\View\Element\Template"")->setTemplate(""Magento_Theme::html/test.phtml"")->toHtml();?>

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.