7

I'm tying to add a simple block to the header using the default template class with the following code

<block class="Magento\Framework\View\Element\Template" name="test.trigger" template="trigger.phtml"/>

This is inside a container next to a custom class block I wrote so i know the containers and everything else all works. If I change the class to the same as my custom class it works.

So i can use my modules custom class and it will render out fine, how can i use the default template class without needing to extend it pointlessly in my module?

10

Try following way:

<block class="Magento\Framework\View\Element\Template" name="test.trigger" template="Vendor_Module::trigger.phtml"/>
  • @Chris Morris did you try this answer? – Sohel Rana Jan 17 '17 at 6:54
  • Only just got back onto the project, seem to have worked. Thanks. – Chris Morris Jan 19 '17 at 16:48

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.