Magento 2: How to Show All Layout Xml for Certain Page

Introduction Imagine you should fix something in Magento 2 on the product listing page, for example. You added an data (like new block with arguments, for example) to the catalog_category_view.xml layout but your changes doesn’t respond on front-end. Solution To check if your data exists in the catalog_category_view.xml layout you should print all layout on the product listing page. Navigate to the following class and method: \Magento\Framework\View\Layout\Builder::generateLayoutXml After this line $this->layout->generateXml(); add the following...

April 30, 2023 · 1 min