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.

  1. Navigate to the following class and method:
\Magento\Framework\View\Layout\Builder::generateLayoutXml
  1. After this line
$this->layout->generateXml();

add the following

var_dump($this->layout->getXmlString());
exit;
  1. Re-fresh the cache and reload product listing page.

And you will see the layouts which Magento 2 comabined before render front-end.

It will look like this: output-all-layout-xml-in-magento-2