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?

asked Jan 13, 2017 at 17:33

1 Answer 1

21

Try following way:

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

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.