12

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

/public_html/vendor/magento/module-catalog-search/view/frontend/templates/advanced/form.phtml

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

 /public_html/app/design/frontend/Emthemes/everything/shoppingcenter
asked Jun 7, 2017 at 21:01
1
  • what's this file is used for /public_html/app/design/frontend/Emthemes/everything/shoppingcenter ? Commented Jun 8, 2017 at 4:54

3 Answers 3

25

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"}}
answered Jun 8, 2017 at 5:00
0
5

The .phtml file location will be:

/public_html/app/design/frontend/Emthemes/everything/shoppingcenter/templates/advanced/form.phtml

And calling it on a block like this:

{{block class="Magento\Framework\View\Element\Template" name="formblock" template="Vendor_Module::advanced/form.phtml"}}
Amit Dwivedi
1,57020 silver badges38 bronze badges
answered Mar 27, 2019 at 6:45
1

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

answered Nov 19, 2019 at 11:28

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.