1

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?

Magento 2 - Layout Update XML

asked Sep 13, 2019 at 21:35

1 Answer 1

1

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>
answered Sep 13, 2019 at 21:59

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.