I want to create an empty container and get it rendered. Currently my empty container isn't showing up.
<container name="empty-container" htmlTag="div" htmlClass="my-class"/>
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityI want to create an empty container and get it rendered. Currently my empty container isn't showing up.
<container name="empty-container" htmlTag="div" htmlClass="my-class"/>
An empty container can be forced to render by including a text block.
<!-- Force container to render -->
<block class="Magento\Framework\View\Element\Text">
<arguments>
<argument name="text" xsi:type="string"><![CDATA[ ]]></argument>
</arguments>
</block>
Thanks to https://gist.github.com/Quinten/47ed93666001938b988d
Add this empty block to container.
<block class="Magento\Framework\View\Element\Text" name="empty-block">
<action method="setText">
<argument name="text" xsi:type="string"><![CDATA[ ]]></argument>
</action>
</block>