Skip to content

Magento 2 Category wise call Different template [category_id layout handle in M2]

Now let’s get to the creating different template file for different categories in Magento 2. Obviously, the identifier should be category id. We can achieve that by creating a new XML file named catalog_category_view_id_{{id}}.xml under our Theme >> Magento_Catalog >> layout.

For eg. for a category id. 10, the xml file we need to create is catalog_category_view_id_10.xml and change the list.phtml file under this.

Share via
Copy link
Powered by Social Snap