0

I need to insert a phtml file in a static block. The Location of the file is

app/design/frontend/Pearl/weltpixel_custom/edu/custom.phtml

I use "weltpixel_custom" as my child theme

This is the code in the static block:

{{block class="Magento\Framework\View\Element\Template" template="weltpixel_custom::edu/test.phtml"}}

I got the following error: Invalid template file: 'weltpixel_custom::edu/test.phtml' in module: '' block's name: 'magento\framework\view\element\template_0'

Do you a solution? In Magento 1.9 it worked with this code:

{{block type="core/template" template="edu/test.phtml"}} 

and following file location:

app/design/frontend/ultimo/edu/template/edu

Thank you for helping!

New contributor
Maurizio is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
1
  • Are you able to resolve it? I have added answer. Please check. – ZealousWeb Feb 22 at 12:07
0

You have called it wrong way. "weltpixel_custom" is a child theme of "weltpixel" , this is not any module so you have to move this "custom.phtml" file in any of the module like below,

path - app/design/frontend/Pearl/weltpixel_custom/Magento_Catalog/edu/custom.phtml

Like above you have to move any of the other module. I have moved it in Magento_Catalog module.

After that you have to call like below

{{block class="Magento\Framework\View\Element\Template" template="Magento_Catalog::edu/test.phtml"}}
1
  • 1
    Thank you! It works! – Maurizio Feb 22 at 22:33

Your Answer

Maurizio is a new contributor. Be nice, and check out our Code of Conduct.

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.