I'm trying to add a new container to a layout (extending Magento Blank) but it's not rendering in HTML. I added the following to:
app/design/frontend/VENDOR/MYTHEME/Magento_Theme/layout/default.xml
<container name="mike.container" as="mikeContainer" label="Mike Container" htmlTag="div" htmlClass="mike-container" />
I cleaned the cache and refreshed the page and then looked at the source code rendered by my browser but a div with a class of "mike-container" doesn't exist.
Do I need to do something else?
Thank you
Best Answer
David's answer is correct, but his example doesn't work (for me anyway).
If you swap the text block in his example with a template block you'll see the container then displays.
My full example to get it working:
app/design/frontend/PACKAGE/THEME/Magento_Cms/layout/default.xml
app/design/frontend/PACKAGE/THEME/Magento_Cms/templates/test.phtml
Result
If I remove the template block, the container is no longer rendered.