I want to make a cms static block which should display/render the content of a .phtml file (echo "Test1"). Content of my cms static block:
<div id="something">
{{block class="Magento\Catalog\Block\Product\View\Description" name="test" template="product/view/test1.phtml" }}
</div>
something like that. Would this work out ?
Location of "test1.phtml" is in vendor\magento\module-catalog\view\frontend\templates\product\view\test1.phtml
Also: what if I change location of "test1.phtml", how can I write it in {{ … }} ?
Best Answer
You can use
Magento\Framework\View\Element\Template
basic template.Try this:
This should work.
UPDATE:
If you need to display product information you have to use blocks from prduct view. Example:
PHTML file position depends on your architecture. If you are not embedding this in a module you could put it in your template.
Example:
And put your file under:
design/frontend/yourtheme/default/Magento_Theme/mytemplate.phtml