0

I am building a custom magento theme in magento 2.1. While developing I noticed that whatever change I am making to app/design/frontend/vendor/theme/Magento_Customer/layout/default.xml is affecting on category listing page and home page also. The changes supposed to be happen only in account sections, right? here I am attaching my app/design/frontend/vendor/theme/Magento_Customer/layout/default.xmlfile.

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

<body>


    <referenceContainer name="content" htmlTag="div" htmlClass="container myaccount">
        <referenceContainer name="content.inner" htmlTag="div" htmlClass="test-class-4">
        </referenceContainer>
    </referenceContainer>


   <move element="sidebar.main" destination="content" before="account.content.inner"/>
    <referenceBlock name="sidebar.main" htmlTag="div" htmlClass="col-md-3 col-xs-12 account-left"/>
    <referenceBlock name="category-sidebar" remove="true"/>
    <referenceBlock name='customer-account-navigation-downloadable-products-link' remove='true'/>
     <referenceBlock name="customer-account-navigation-my-credit-cards-link" remove="true"/>
    <referenceBlock name="customer-account-navigation-billing-agreements-link" remove="true"/>

</body>

Any idea why is it so?

0

After some digging up I could find a solution. I have removed the layout overriding codes from app/design/frontend/vendor/theme/Magento_Customer/layout/default.xml and added them in app/design/frontend/vendor/theme/Magento_Customer/layout/customer_account.xml . And everything worked perfectly alright.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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