12

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?

1 Answer 1

21

Try following way:

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.