I have a CMS Page with '2 Column Right' layout. I want to add 'My Cart','Compare Products','Newsletter' Sidebars in right column.


How is it possible?


Add this code in design tab of cms page:

<referenceContainer name="sidebar.additional">
        <!-- Compare Block -->
        <block class="Magento\Framework\View\Element\Template" name="catalog.compare.sidebar"
                <argument name="jsLayout" xsi:type="array">
                    <item name="components" xsi:type="array">
                        <item name="compareProducts" xsi:type="array">
                            <item name="component" xsi:type="string">Magento_Catalog/js/view/compare-products</item>
        <!-- Newsletter Block -->
        <block class="Magento\Newsletter\Block\Subscribe" name="form.subscribe" as="subscribe" before="-" template="subscribe.phtml"/>


However I am not sure how you can add the "My Cart" block.

This code will just add the blocks. If you wish to add Title and extra text to the blocks use this code instead in the content tab of cms page.

<div class="block widget block-compare">
    <div class="block-title">
        <strong role="heading">Compare Products</strong>
    {{block class="Magento\Framework\View\Element\Template" name="catalog.compare.sidebar" template="Magento_Catalog::product/compare/sidebar.phtml" /}}
<div class="block widget block-newsletter">
    <div class="block-title">
        <strong role="heading">Newsletter</strong>
    {{block class="Magento\Newsletter\Block\Subscribe" name="form.subscribe" as="subscribe" before="-" template="subscribe.phtml"/}}


You can create a static block say 'test' in the Admin. Add this code:

 {{block class="Magento\Newsletter\Block\Subscribe" name="form.subscribe" template="subscribe.phtml"/}}

Create a widget. Go to Content >> Widgets Add layout update to the page you wish to add this block to and set the container to Sidebar Additional.

  • Used the layout code, Compare sidebar is working now. But newsletter is not May 29 '17 at 9:15
  • @Jancy Abraham check my updated answer.
    – Sejal Shah
    May 29 '17 at 11:59
  • @Jancy did u check my updated answer ?
    – Sejal Shah
    Jun 3 '17 at 13:59
  • I want to display it in a specified CMS page(Only one). It is possible in Widgets layout Jun 5 '17 at 4:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.