How To Move CMS Static Block Before Breadcrumbs In Magento 2 Category Page
The post gives a programmatic solution to move CMS static block before breadcrumbs in Magento 2 category page.
Why do you need to do so?
Because design matters!
The webpage design is its ID that helps outstand among the overcrowded competitors.
Placing the webpage elements of the correct size in the right position affects the user experience.
Placing the breadcrumbs in the right position according to the nature of your site can be helpful and this solution gives the programmatic solution to make the task easier.
Method to Move CMS Static Block Before Breadcrumbs In Magento 2 Category Page:
Create file catalog_category_view.xml
1 2 3 4 5 6 7 |
<?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <move element="category.cms" destination="page.top" after="breadcrumbs"/> </body> </page> |
That’s it.
Use the Comments section below if you have any doubts about the implementation. I am happy to solve it.
Do share the solution with fellow developers via social media.
Thanks.
Sanjay Jethva
Sanjay is the co-founder and CTO of Meetanshi with hands-on expertise with Magento since 2011. He specializes in complex development, integrations, extensions, and customizations. Sanjay is one the top 50 contributor to the Magento community and is recognized by Adobe.
His passion for Magento 2 and Shopify solutions has made him a trusted source for businesses seeking to optimize their online stores. He loves sharing technical solutions related to Magento 2 & Shopify.
Prev
Meetanshi Magento Extensions Launches and Updates January [2020]
Team Meetanshi at Meet Magento India 2020 – Recap & Insights
Next