How to add a static block on CMS page

Working on a project, You might have to add static blocks on a CMS page. You can add it via the Magento admin panel.

We will try to add a static block “store-address-info” into the cms “Home Page”.

  1. Login to admin page -> content -> pages, select and edit the cms “Home Page”.
  2. Go to the tab design and insert below code and save the page:
<referenceContainer name="content">
     <block class="Magento\Cms\Block\Block" name="storeinfo">
        <arguments>
            <argument name="block_id" xsi:type="string">store-address-info</argument>
        </arguments>
    </block>
</referenceContainer >

Now, go to the homepage, you will see the store info.

Leave a Reply

Your email address will not be published. Required fields are marked *