i would like to call a Magento phtml file to a static block I have a custom theme! how to do it, please? here


is where the phtml file is located what should i do to call it ?

  • what's this file is used for /public_html/app/design/frontend/Emthemes/everything/shoppingcenter ? – Rakesh Jesadiya Jun 8 '17 at 4:54

You can use Magento\Framework\View\Element\Template class to call phtml files

{{block class="Magento\Framework\View\Element\Template" template="Vendor_Module::myfiles/myfile.phtml"}}

To call advanced form use Magento\CatalogSearch\Block\Advanced\Form block class.

{{block class="Magento\CatalogSearch\Block\Advanced\Form" name="block_name" template="Magento_CatalogSearch::advanced/form.phtml"}}
| improve this answer | |

The .phtml file location will be:


And calling it on a block like this:

{{block class="Magento\Framework\View\Element\Template" name="formblock" template="advanced/form.phtml"}}
| improve this answer | |

@Prince: I am working on same, the advanced form submission is not working, it's getting 404 error when clicking on Search button.

| improve this answer | |

The .phtml file location will be: {{block class="Magento\Framework\View\Element\Template" template="Magento_Theme::test.phtml"}}

| improve this answer | |

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.