0

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

2 Answers 2

1

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 /

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

Custom file path

app/design/frontend/{Package}/{theme}/Magento_Theme/templates/html/test.phtml

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 and acknowledge that you have read and understand our privacy policy and code of conduct.

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