Close

     

Our Blog

How to add custom layout handle to category in Magento 2

December 6, 2018 // by Burlacu Vasilii

Disclaimer:

This post assumes the reader is familiar with Magento 2 modules and how they work. If not, it is highly recommended to read the documentation first. All files mentioned below must be placed inside a module.

TL;DR

In order to add a custom layout handle to category page, a (basic) Magento 2 module with these additional files and their content is needed:

1. The events.xml file to “subscribe” to the event and say which observer should be fired
2. An observer that adds a new layout handle to the page
3. A layout file that adds needed changes to the page

Comments (0)