Magento 2 – Location of Layout XML File for Homepage

home-pagelayoutmagento2xml

\vendor\magento\module-catalog\view\frontend\layout\catalog_product_view.xml
is the layout xml file for Product Detail Page.

Where are the layout xml files for Homepage and for Category Page (page that shows after clicking on a category link ex. 'http://127.0.0.1/magento/category-1.html', where layered navigation is displayed) ?

what I mean by Catgory Page:
enter image description here

thanks

Best Answer

Magento-2 file path hierarchy

First check in your current theme

app/design/frontend/YourTheme/ThemePackage/Magento_Catalog/layout/catalog_category_view.xml
app/design/frontend/YourTheme/ThemePackage/Magento_Cms/cms_index_index.xml

Second check in your current theme parent theme.

app/design/frontend/CurrentParentTheme/ThemePackage/Magento_Catalog/layout/catalog_category_view.xml
app/design/frontend/CurrentParentTheme/ThemePackage/Magento_Cms/cms_index_index.xml

Third check in core module.

vendor/magento/module-cms/view/frontend/layout/cms_index_index.xml
vendor/magento/module-catalog/view/frontend/layout/catalog_category_view.xml

For home page you have to check in current assign home page

Admin >> Content >> Pages >> Selecte your current home page.

Check home page content and Layout Update XML in Design tab.

Related Topic