Magento 2: Add a Static Template Block in Layout XML

Magento 2: Add a Static Template Block in Layout XML

Add a template block to a Magento 2 layout with Magento\Framework\View\Element\Template — a minimal, copy-paste example for any theme.

Magento 2 add static template

<block class="Magento\Framework\View\Element\Template" name="store.settings" group="navigation-sections" template="Magento_Theme::html/container.phtml">

 

Further reading: Adobe Commerce frontend developer guide. Need a hand? Our Magento development team can help.

Need a hand?

Stuck on a build?
Let's solve it together.

Our engineers fix, upgrade and scale Magento, WordPress and modern stacks every day.