Magento 2: Add a CMS Static Block via XML Updates in you homepage

These are the steps to add a CMS Static block to your homepage using XML Updates in XML files.

  1. Go to the Admin Panel > Content > Blocks
  2. Click on “Add new Block”
  3. Create your custom block, make sure that the option “Enabled” is checked and save it.
  4. In the project code, go to app/design/frontend/[VendorName]/[themeName]/ and add the following file

app/design/frontend/[VendorName]/[themeName]/Magento_Cms/layout/cms_index_index.xml

 NOTE: You can use “before” or “after” to place the block as you want.

That’s it!.

Clear cache and that should be it. Your static block should be displayed on the homepage.

Be the first to comment

Leave a Reply

Your email address will not be published.


*


*