CMS blocks in Magento 2 allow you to display static or dynamic content on your website. Using widgets, you can place these blocks in specific locations, enhancing your store's design and functionality. Follow this step-by-step guide to learn how to display CMS blocks using widgets in Magento 2.
By following these steps, you can effectively display CMS blocks using widgets in Magento 2, ensuring a seamless user experience and better content management.
Step 1: Access the Magento Admin Panel
Log in to your Magento 2 Admin Panel and navigate to Content > Blocks.Step 2: Create a New CMS Block
Click the Add New Block button in the upper-right corner.
Step 3: Fill in the Block Information
- Block Title: Enter the title for the block (e.g., "Static Banner").
- Identifier: Enter a unique identifier for the block. This will be used to call the block in your layout or code (e.g., static_banner).
- Store View: Select the store views where the block should be visible.
- Status: Set the status to Enabled if you want the block to be active.
- Content: Use the Pagebuilder editor to add your content. You can include HTML, images, and other elements here.
Step 4: Save the Block
Once you've filled in the necessary details, click the Save Block button.Create a widget in the Admin Panel:-
Step 5: Access the Magento Admin Panel
Log in to your Magento 2 Admin Panel and Navigate to Content > Widgets.Step 6: Add a New Widget
Click the Add Widget button in the upper-right corner.Step 7: Configure Widget Settings
- Type: In the Type dropdown, select CMS Static Block.
- Design Theme: Choose the appropriate theme from the Design Theme dropdown (usually, it's the theme you're currently using).
- Click Continue.

Step 8: Fill out the Storefront Properties.
- Give your widgets a Title.
- Assign it to Store Views it should be active on.
- Set the Sort Order.

- Set the exact page and place where you want to display the CMS block in the Layout Updates.
- Choose any Category, Product or Generic Pages to place the CMS block.
- Select a Container, the exact place on the page where you want to display your CMS block.

Step 9: Go to Widgets Options and select the CMS block to assign to this widgets.

- Save the widgets.
Step 10: Clear the Magento cache
Run this command in your terminal:-php bin/magento cache:flush

Need Help Optimizing Your Magento Store?
If you want to enhance your Magento store further and make it stand out, let us assist you! ? What We Offer:- Expert Magento Development: From CMS block setup to custom themes and extensions.
- Performance Optimization: Ensure your store loads faster and delivers a superior user experience.
- E-commerce Strategy: Tailored solutions to grow your business and increase conversions.
- Continuous Support: Reliable maintenance and updates to keep your store running smoothly.