Here are the steps that you will follow in this How To Call a Static Block On CMC Page:

  1. Login to admin page -> content -> pages, we will select and edit the cms “Home Page”.
  2. Go to the tab design and insert the command and save page
  3. Go to the homepage, you will see the contact us info

While working on a project, You might have to add a unique static block between the header and main content of the CMS page on each CMS page. Via Magento admin panel,  Element can be fully customizable  and it can be easy to create on new CMS pages, easily modifiable , removable. Because element need to be placed outside of the main content, element can not be added using CMS in Magento admin. It can be added using Magento layouts. 

Related:

On the Magento admin panel, by editing CMS page from CMS editor, Magento enables us to define a custom layout for every CMS page. In addition, layout for a CMS page is modified using defined values for that specific page which are stored in the database.Here’s how you might achieve that.

call a static block on cms page
call a static block on cms page

We will try to add the block “contact-us-info” into the cms “Home Page”.

Step 1:

Login to admin page -> content -> pages, we will select and edit the cms “Home Page”.

Step 2:

Go to the tab design and insert the command and save page:

  • Now, go to the homepage, you will see the contact us info.

By another way:

1 Login to admin page -> content -> Widgets and click “Add New Widget”.
2 You can select type as “CMS Static Block” and select “Magento luma” ( Design Package/Theme ) and click continue
3 Now, you can set “Widget Title”, “Store” and “Sort order” in “Storefront properties” tab.
4 And then you can select static block contact-us-info from in the “Widget options” tab.
5 On the “Storefront properties” tab, click on “Add Layout Update” button and select option from display on dropdown “Specific page”.
6 Now, you can choose “CMS home page” in the page option and choose “main content top” in the container option.
How to Create Magento 2 Widget?

Leave a Reply

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