Created
January 5, 2016 16:17
-
-
Save Quinten/47ed93666001938b988d to your computer and use it in GitHub Desktop.
Sometimes you just need an empty container in Magento 2. But when a container is empty (contains no blocks) it is not rendered. This way you can add a html comment inside the container.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<block class="Magento\Framework\View\Element\Text" name="comment.placeholder"> | |
<arguments> | |
<argument name="text" xsi:type="string"><![CDATA[<!-- -->]]></argument> | |
</arguments> | |
</block> |
@CNSam because of this @chedaroo's solution doesn't work anymore. When in need an empty container, the shortest solution I've found atm is following (open for suggestions)
<!-- Force container to render -->
<block class="Magento\Framework\View\Element\Text">
<arguments>
<argument name="text" xsi:type="string"><![CDATA[ ]]></argument>
</arguments>
</block>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@chedaroo seems this doesn't work in 2.1.7