Magento2 Layout XML – Where Layout Handles Are Defined by a Module

layoutmagento2xml

I want to find all of the handles available for a module whether they are in vendor/magento/module/view/layouts/... or not.

What is the best way to see all of the handles that can be used for a module?

Best Answer

To me, the layout related to each module can be found directly in the module view/layouts folder

However, if you have a doubt I suggest you do the following.

  • Find the route name of your module in the routes.xml e.g. catalog
  • Run the following command from your Magento 2 directory: find . -type f -name 'catalog_*.xml' (replace catalog with the route you just found)

It will give you a list of every layout file related to the route you specified and thus you can have a list of handles.

Related Topic