cancel
Showing results for 
Search instead for 
Did you mean: 

Add a static block to sidebar of a CMS page

Highlighted

Add a static block to sidebar of a CMS page

I am using magento 2.0 and have created my CMS page that reflects all the contents properly. However, when I created a static block under the widget tab I encountered a few problems;-

1. The new CMS page wont reflect in the list of pages on which the block is to be applied.

2.Because of my first issue instead of my recently created CMS page I tested whether my block was getting applied to other CMS pages and it wasnt.

Is there a way through which I can achieve this without having to make any changes in default.xml?

aaimonqureshi
1 REPLY 1
Highlighted

Re: Add a static block to sidebar of a CMS page

Hi @aaimonsuprf153 ,

 

Can you try adding below code in your CMS Page Design Section

Layout: 2 Columns with left sidebar

Custom layout update:

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

Replace the Block Id in the bold character space.

 

And for other CMS Pages, if your static block is not showing please check whether your cms pages Layout is  2 Columns with left sidebar or not.

 

Flush the Magento cache.

 

Hope this helps you!

Problem Solved! Click Kudos & Accept as Solution!