I'm trying to add a new CMS block into the sidebar and remove all other blocks there, using only the Layout Update XML section in a CMS Page via the admin panel, how could I do it?
1 Answer
You don't need to use the initial tags (e.g. page and body), you might be able to remove the Compare products and Wishlist from the sidebar and add your custom CMS Block via this snippet below:
<referenceContainer name="content">
<block class="Magento\Cms\Block\Block" name="contact_information" before="-">
<arguments>
<argument name="block_id" xsi:type="string">contact_information</argument>
</arguments>
</block>
</referenceContainer>
<move element="contact_information" destination="sidebar.additional" before="-" />
<referenceContainer name="sidebar.additional">
<referenceBlock name="catalog.compare.sidebar" remove="true"/>
<referenceBlock name="wishlist_sidebar" remove="true"/>
</referenceContainer>