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!

Kaushal Suthar
3,2576 gold badges33 silver badges57 bronze badges
asked Feb 20, 2021 at 3:19
1
  • Are you able to resolve it? I have added answer. Please check. Commented Feb 22, 2021 at 12:07

1 Answer 1

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"}}
answered Feb 22, 2021 at 9:25
1
  • 1
    Thank you! It works! Commented Feb 22, 2021 at 22:33

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.