Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jpgreth/0960eaea66d975b3d68527e95661ad91 to your computer and use it in GitHub Desktop.
Save jpgreth/0960eaea66d975b3d68527e95661ad91 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.
<block class="Magento\Framework\View\Element\Text" name="comment.placeholder">
<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