I have followed the below links to try and get PHP code into CMS Block which links to a .phtml file, with no avail.
Show content of phtml file on static block Magento 2
Currently on our M1 website we have the below setup:
Page Content:
{{block type="catalog/product" template="catalog/pages/towbars.phtml"}}
Referencing the links above, I have tried modifying this, however I am unsure exactly what my "block class" should be and the "template".
{{block class="Path\To\Block\Class" template="Namespace_Module::filename.phtml"}}
Can someone please give me a working example of the above code for Magento 2 and the location of the file, etc.
Many Thanks,
Barry
Best Answer
You can use
Magento\Framework\View\Element\Template
class to callphtml
filesTo call advanced form use
Magento\CatalogSearch\Block\Advanced\Form
block class.I hope it will help for you.