I have created a custom block using Magento 2 UI, I know that I can't have any PHP in the block so I have created a test.phtml file and added it to my custom theme on the server.

Now, I want to call that block but can't figure out what path it will be.

The location of the test.phtml is following:


How should I call this test.phtml file in my block? I got something like this but it's not working:

{{block type="core/template" template="app/design/frontend/CustomTheme/CustomChild/Custom_Themesettings/templates/html/test.phtml"}}

3 Answers 3


File location will be


calling a block

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

I presume you mean a static block in the admin? If so try this:

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

Why Custom_Themesettings? if you want to add it in your theme use : app/design/frontend/{package}/{themename}/Magento_Theme/templates/html/test.phtml, if you have created a custom module put it : app/code/{Vendor}/{Modulename}/view/frontend/templates/html/test.phtml

To call the theme one :

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

the module one :

{{block class="{Vendor}\{Modulename}\Block\{Blockname.php}" template="Vendor_Modulename::html/test.phtml"}}

Your Answer

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

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