In order to create custom sidebar menus for my CMS pages in Magento 1, I used to be able to create a static block, and then use a widget to place it on all CMS pages that had a 2 column layout with left bar. That option is not avaialble in Magento 2.

So, for Magento 2, I created a block called "guidenav", and I want it to appear on certain CMS pages, and for those CMS pages I can using this code in Layout Update XML:

<referenceContainer name="sidebar.additional">
    <block class="Magento\Cms\Block\Block" name="guidenav">
        <arguments>
            <argument name="block_id" xsi:type="string">guidenav</argument>
        </arguments>
    </block>
</referenceContainer>

The block isn't showing up. Any ideas?

  • In Magento 2 also you can create a cms block for guidenav and use a widget to place it on all CMS pages. – Sejal Shah Jul 27 '17 at 5:16

I found the solution in case this will help anyone. In Magento 2, if you want to create a left side bar navigation, (and remove wishlist and compare), you need the following code in the CMS Page Layout Update XML (I dont like editing files if I dont have to, thats why I like sysing Layout Update XML). My block is called "guidenav" that calls the menu.

<referenceContainer name="sidebar.additional">
<referenceBlock name="catalog.compare.sidebar" remove="true"/>
<referenceBlock name="wishlist_sidebar" remove="true" />
<referenceBlock name="sale.reorder.sidebar" remove="true" />
           <block class="Magento\Cms\Block\Block" name="guidenav">
                <arguments>
                    <argument name="block_id" xsi:type="string">promo</argument>
                </arguments>
            </block>
</referenceContainer>

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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