\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. '', where layered navigation is displayed) ?

what I mean by Catgory Page: enter image description here


  • hello @Blackpanther0001, how did you change your header style, my stylesheet is not showing up in the source files. can you help me? Oct 21, 2020 at 5:34

3 Answers 3


Magento-2 file path hierarchy

First check in your current theme


Second check in your current theme parent theme.


Third check in core module.


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.

  • Please keep in mind cms_index_index.xml does not cover the homepage if you navigate with /home at the end of the url! Magento will handle the page as cms-page-view not as cms-index-index Aug 27, 2018 at 9:10

The homepage is vendor/magento/module-cms/view/frontend/layout/cms_index_index.xml. Category page is vendor/magento/module-catalog/view/frontend/layout/catalog_category_view.xml.


Remove all content from default.xml that should be displayed on the homepage, content region, e.g. all of your custom blocks.

Then create a file called cms_index_index.xml in the same place where your default.xml lives, with the following content:

<?xml version="1.0"?>
 * cms_index_index.xml
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 * This file only is displayed on the homepage of magento
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

    <referenceContainer name="content">
        <!-- Insert your blocks just for the homepage here, e.g. -->
        <container htmlTag="section" htmlClass="widget block block-static-block newsletter-block">
            <block class="Magento\Cms\Block\Widget\Block" name="newsletter" template="Magento_Theme::html/subscribe.phtml">
                    <argument name="block_id" xsi:type="string">newsletter</argument>
        <container htmlTag="section" htmlClass="widget block block-static-block view-catalogue-block">
            <block class="Magento\Cms\Block\Widget\Block" name="view_catalogue" template="Magento_Theme::html/view-catalogue.phtml">
                    <argument name="block_id" xsi:type="string">view_catalogue</argument>



Tested on Magento 2.2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.