1

I created a template (phtml) and placed it into my theme folder. I then went to a cms block and placed this

{{block class="Magento\Framework\View\Element\Template" template="Magento_Theme::footer-social.phtml"}}

Nothing renders. I've read other posts in regard to this and they all seem to be similar.

1

Looks like template path is incorrect.

In your example Magento will search your template at path:

app/code/Magento/Theme/view/frontend/templates/footer-social.phtml

Next syntax works for me, inserted directly into Content > Pages > Home Page > Content (WYSIWYG hidden)

{{block class="Magento\Framework\View\Element\Template" template="Yaronish_Cms::home.phtml"}}

enter image description here

File path app/code/Yaronish/Cms/view/frontend/templates/home.phtml

File Content

<div>My Home Template</div>
<?php
    echo microtime(true);
?>

Result: enter image description here

  • I moved my file there. I was in design and not the code folder. It didn't change anything. Do I need to run a deployment script? – Matthew McLennan Feb 2 '17 at 18:34
  • You have to clean Page Cache – yaronish Feb 2 '17 at 18:36
  • I did. Still no change. Is that the appropriate class to use? – Matthew McLennan Feb 2 '17 at 19:49
  • Want to help you, but I need additional information: Magento version, template path, template content, cms block content. Thanks. – yaronish Feb 2 '17 at 20:46

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.