Magento 2: Override XML file from vendor folder to app folder doesn't work/update












1















I tried to override the XML file by copying the file from




vendor/magento/module-catalog/view/frontend/layout/catalog_category_view_type_default.xml




to




app/design/frontend/Infortis/base/Magento_Catalog/layout/catalog_category_view_type_default.xml




However, it is still loading the file from the vendor folder. I have tried clear & flush the cache, redeploy static content, but doesn't work.



below is the change i made ( comment out the container)



<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<!--<referenceContainer name="sidebar.main">
<block class="MagentoCatalogBlockNavigation" name="catalog.leftnav" before="-" template="Magento_Catalog::navigation/left.phtml"/>
</referenceContainer>--> <!--remove shop by category from category listing page -->
</body>
</page>









share|improve this question

























  • There could be 2 reasons, 1- your theme folder is in correct, ( i.e base ) move your folder to other folder which is actually being used by the theme. 2- Magento_Catalog layout is overriding by another module.

    – Naveed Asim
    yesterday











  • you want to remove sidebar.main allover website?

    – Rakesh Donga
    yesterday
















1















I tried to override the XML file by copying the file from




vendor/magento/module-catalog/view/frontend/layout/catalog_category_view_type_default.xml




to




app/design/frontend/Infortis/base/Magento_Catalog/layout/catalog_category_view_type_default.xml




However, it is still loading the file from the vendor folder. I have tried clear & flush the cache, redeploy static content, but doesn't work.



below is the change i made ( comment out the container)



<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<!--<referenceContainer name="sidebar.main">
<block class="MagentoCatalogBlockNavigation" name="catalog.leftnav" before="-" template="Magento_Catalog::navigation/left.phtml"/>
</referenceContainer>--> <!--remove shop by category from category listing page -->
</body>
</page>









share|improve this question

























  • There could be 2 reasons, 1- your theme folder is in correct, ( i.e base ) move your folder to other folder which is actually being used by the theme. 2- Magento_Catalog layout is overriding by another module.

    – Naveed Asim
    yesterday











  • you want to remove sidebar.main allover website?

    – Rakesh Donga
    yesterday














1












1








1








I tried to override the XML file by copying the file from




vendor/magento/module-catalog/view/frontend/layout/catalog_category_view_type_default.xml




to




app/design/frontend/Infortis/base/Magento_Catalog/layout/catalog_category_view_type_default.xml




However, it is still loading the file from the vendor folder. I have tried clear & flush the cache, redeploy static content, but doesn't work.



below is the change i made ( comment out the container)



<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<!--<referenceContainer name="sidebar.main">
<block class="MagentoCatalogBlockNavigation" name="catalog.leftnav" before="-" template="Magento_Catalog::navigation/left.phtml"/>
</referenceContainer>--> <!--remove shop by category from category listing page -->
</body>
</page>









share|improve this question
















I tried to override the XML file by copying the file from




vendor/magento/module-catalog/view/frontend/layout/catalog_category_view_type_default.xml




to




app/design/frontend/Infortis/base/Magento_Catalog/layout/catalog_category_view_type_default.xml




However, it is still loading the file from the vendor folder. I have tried clear & flush the cache, redeploy static content, but doesn't work.



below is the change i made ( comment out the container)



<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<!--<referenceContainer name="sidebar.main">
<block class="MagentoCatalogBlockNavigation" name="catalog.leftnav" before="-" template="Magento_Catalog::navigation/left.phtml"/>
</referenceContainer>--> <!--remove shop by category from category listing page -->
</body>
</page>






magento2 layout overrides xml






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited yesterday







Kris Wen

















asked yesterday









Kris WenKris Wen

427




427













  • There could be 2 reasons, 1- your theme folder is in correct, ( i.e base ) move your folder to other folder which is actually being used by the theme. 2- Magento_Catalog layout is overriding by another module.

    – Naveed Asim
    yesterday











  • you want to remove sidebar.main allover website?

    – Rakesh Donga
    yesterday



















  • There could be 2 reasons, 1- your theme folder is in correct, ( i.e base ) move your folder to other folder which is actually being used by the theme. 2- Magento_Catalog layout is overriding by another module.

    – Naveed Asim
    yesterday











  • you want to remove sidebar.main allover website?

    – Rakesh Donga
    yesterday

















There could be 2 reasons, 1- your theme folder is in correct, ( i.e base ) move your folder to other folder which is actually being used by the theme. 2- Magento_Catalog layout is overriding by another module.

– Naveed Asim
yesterday





There could be 2 reasons, 1- your theme folder is in correct, ( i.e base ) move your folder to other folder which is actually being used by the theme. 2- Magento_Catalog layout is overriding by another module.

– Naveed Asim
yesterday













you want to remove sidebar.main allover website?

– Rakesh Donga
yesterday





you want to remove sidebar.main allover website?

– Rakesh Donga
yesterday










2 Answers
2






active

oldest

votes


















2














If Infortis/base is your theme name (base is a weird name to give to a theme and usually this is written in CamelCase) and you have set your theme up like here then there are certain rules before it will show




  1. Select your theme under Content > Design > Configuration > Select the right store and select Infortis/base there. The theme that you select there is the one that does the xml changes.

  2. In your XML you need to use referenceBlock, referenceContainer or create a new block/container. More documentation here

  3. In developer mode you can check your magento_root/var/log/system.log to check for parents that a block maybe can not find. Be sure that your log level in your nginx or apache settings are set to log all

  4. You should consider load orders. More information here


UPDATE



Commenting out something does not remove anything. You do not 'overwrite' the XML but extend it by using it.



You can however remove something like this :



<referenceContainer name="name-of-the-container" remove="true"/>
<referenceBlock name="name-of-the-block" remove="true"/>





share|improve this answer


























  • my theme name is Infortis/ultimo, which is the child of the infortis/base theme. I also tried to put into the Ultimo folder in app/design/frontend/Infortis/ultimo/Magento_Catalog/layout/, but still not working. I'm only commenting out the "<referenceContainer name="sidebar.main"> ...." in the xml. i will check through the log file. thanks

    – Kris Wen
    yesterday













  • What is it exactly that you have changed in the xml?

    – CompactCode
    yesterday











  • I'm commenting out the "<referenceContainer name="sidebar.main">" container, so that the "Shop By Category" can be remove from the category view page. (Updated my question with the change i made to the xml file)

    – Kris Wen
    yesterday













  • See my updated answer

    – CompactCode
    yesterday











  • that works! thanks a lot. still a lot to learn =)

    – Kris Wen
    yesterday



















2














Try to this way...



vendor/magento/module-catalog/view/frontend/layout/catalog_category_view_type_default.xml


to
app/design/frontend/Infortis/ultimo/Magento_Catalog/layout/catalog_category_view_type_default.xml"



Or
open this file app/design/frontend/Infortis/ultimo/Infortis_Ultimo/layout/default.xml



and add below code



<referenceBlock name="sidebar.main" remove="true"/>


Please don't forget to clear cache after change in xml files






share|improve this answer


























  • unfortunately, it doesn't work

    – Kris Wen
    yesterday











  • i have checked my side this is working you have which mode in working ?

    – Rakesh Donga
    yesterday











  • i'm on developer mode. should i switch to another mode?

    – Kris Wen
    yesterday











  • no mate you have created file my follow path? also check which theme you are check again

    – Rakesh Donga
    yesterday













  • yes, i created the file using the path you provided. it's pretty weird issue..

    – Kris Wen
    yesterday











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "479"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f264383%2fmagento-2-override-xml-file-from-vendor-folder-to-app-folder-doesnt-work-updat%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









2














If Infortis/base is your theme name (base is a weird name to give to a theme and usually this is written in CamelCase) and you have set your theme up like here then there are certain rules before it will show




  1. Select your theme under Content > Design > Configuration > Select the right store and select Infortis/base there. The theme that you select there is the one that does the xml changes.

  2. In your XML you need to use referenceBlock, referenceContainer or create a new block/container. More documentation here

  3. In developer mode you can check your magento_root/var/log/system.log to check for parents that a block maybe can not find. Be sure that your log level in your nginx or apache settings are set to log all

  4. You should consider load orders. More information here


UPDATE



Commenting out something does not remove anything. You do not 'overwrite' the XML but extend it by using it.



You can however remove something like this :



<referenceContainer name="name-of-the-container" remove="true"/>
<referenceBlock name="name-of-the-block" remove="true"/>





share|improve this answer


























  • my theme name is Infortis/ultimo, which is the child of the infortis/base theme. I also tried to put into the Ultimo folder in app/design/frontend/Infortis/ultimo/Magento_Catalog/layout/, but still not working. I'm only commenting out the "<referenceContainer name="sidebar.main"> ...." in the xml. i will check through the log file. thanks

    – Kris Wen
    yesterday













  • What is it exactly that you have changed in the xml?

    – CompactCode
    yesterday











  • I'm commenting out the "<referenceContainer name="sidebar.main">" container, so that the "Shop By Category" can be remove from the category view page. (Updated my question with the change i made to the xml file)

    – Kris Wen
    yesterday













  • See my updated answer

    – CompactCode
    yesterday











  • that works! thanks a lot. still a lot to learn =)

    – Kris Wen
    yesterday
















2














If Infortis/base is your theme name (base is a weird name to give to a theme and usually this is written in CamelCase) and you have set your theme up like here then there are certain rules before it will show




  1. Select your theme under Content > Design > Configuration > Select the right store and select Infortis/base there. The theme that you select there is the one that does the xml changes.

  2. In your XML you need to use referenceBlock, referenceContainer or create a new block/container. More documentation here

  3. In developer mode you can check your magento_root/var/log/system.log to check for parents that a block maybe can not find. Be sure that your log level in your nginx or apache settings are set to log all

  4. You should consider load orders. More information here


UPDATE



Commenting out something does not remove anything. You do not 'overwrite' the XML but extend it by using it.



You can however remove something like this :



<referenceContainer name="name-of-the-container" remove="true"/>
<referenceBlock name="name-of-the-block" remove="true"/>





share|improve this answer


























  • my theme name is Infortis/ultimo, which is the child of the infortis/base theme. I also tried to put into the Ultimo folder in app/design/frontend/Infortis/ultimo/Magento_Catalog/layout/, but still not working. I'm only commenting out the "<referenceContainer name="sidebar.main"> ...." in the xml. i will check through the log file. thanks

    – Kris Wen
    yesterday













  • What is it exactly that you have changed in the xml?

    – CompactCode
    yesterday











  • I'm commenting out the "<referenceContainer name="sidebar.main">" container, so that the "Shop By Category" can be remove from the category view page. (Updated my question with the change i made to the xml file)

    – Kris Wen
    yesterday













  • See my updated answer

    – CompactCode
    yesterday











  • that works! thanks a lot. still a lot to learn =)

    – Kris Wen
    yesterday














2












2








2







If Infortis/base is your theme name (base is a weird name to give to a theme and usually this is written in CamelCase) and you have set your theme up like here then there are certain rules before it will show




  1. Select your theme under Content > Design > Configuration > Select the right store and select Infortis/base there. The theme that you select there is the one that does the xml changes.

  2. In your XML you need to use referenceBlock, referenceContainer or create a new block/container. More documentation here

  3. In developer mode you can check your magento_root/var/log/system.log to check for parents that a block maybe can not find. Be sure that your log level in your nginx or apache settings are set to log all

  4. You should consider load orders. More information here


UPDATE



Commenting out something does not remove anything. You do not 'overwrite' the XML but extend it by using it.



You can however remove something like this :



<referenceContainer name="name-of-the-container" remove="true"/>
<referenceBlock name="name-of-the-block" remove="true"/>





share|improve this answer















If Infortis/base is your theme name (base is a weird name to give to a theme and usually this is written in CamelCase) and you have set your theme up like here then there are certain rules before it will show




  1. Select your theme under Content > Design > Configuration > Select the right store and select Infortis/base there. The theme that you select there is the one that does the xml changes.

  2. In your XML you need to use referenceBlock, referenceContainer or create a new block/container. More documentation here

  3. In developer mode you can check your magento_root/var/log/system.log to check for parents that a block maybe can not find. Be sure that your log level in your nginx or apache settings are set to log all

  4. You should consider load orders. More information here


UPDATE



Commenting out something does not remove anything. You do not 'overwrite' the XML but extend it by using it.



You can however remove something like this :



<referenceContainer name="name-of-the-container" remove="true"/>
<referenceBlock name="name-of-the-block" remove="true"/>






share|improve this answer














share|improve this answer



share|improve this answer








edited yesterday

























answered yesterday









CompactCodeCompactCode

1,492624




1,492624













  • my theme name is Infortis/ultimo, which is the child of the infortis/base theme. I also tried to put into the Ultimo folder in app/design/frontend/Infortis/ultimo/Magento_Catalog/layout/, but still not working. I'm only commenting out the "<referenceContainer name="sidebar.main"> ...." in the xml. i will check through the log file. thanks

    – Kris Wen
    yesterday













  • What is it exactly that you have changed in the xml?

    – CompactCode
    yesterday











  • I'm commenting out the "<referenceContainer name="sidebar.main">" container, so that the "Shop By Category" can be remove from the category view page. (Updated my question with the change i made to the xml file)

    – Kris Wen
    yesterday













  • See my updated answer

    – CompactCode
    yesterday











  • that works! thanks a lot. still a lot to learn =)

    – Kris Wen
    yesterday



















  • my theme name is Infortis/ultimo, which is the child of the infortis/base theme. I also tried to put into the Ultimo folder in app/design/frontend/Infortis/ultimo/Magento_Catalog/layout/, but still not working. I'm only commenting out the "<referenceContainer name="sidebar.main"> ...." in the xml. i will check through the log file. thanks

    – Kris Wen
    yesterday













  • What is it exactly that you have changed in the xml?

    – CompactCode
    yesterday











  • I'm commenting out the "<referenceContainer name="sidebar.main">" container, so that the "Shop By Category" can be remove from the category view page. (Updated my question with the change i made to the xml file)

    – Kris Wen
    yesterday













  • See my updated answer

    – CompactCode
    yesterday











  • that works! thanks a lot. still a lot to learn =)

    – Kris Wen
    yesterday

















my theme name is Infortis/ultimo, which is the child of the infortis/base theme. I also tried to put into the Ultimo folder in app/design/frontend/Infortis/ultimo/Magento_Catalog/layout/, but still not working. I'm only commenting out the "<referenceContainer name="sidebar.main"> ...." in the xml. i will check through the log file. thanks

– Kris Wen
yesterday







my theme name is Infortis/ultimo, which is the child of the infortis/base theme. I also tried to put into the Ultimo folder in app/design/frontend/Infortis/ultimo/Magento_Catalog/layout/, but still not working. I'm only commenting out the "<referenceContainer name="sidebar.main"> ...." in the xml. i will check through the log file. thanks

– Kris Wen
yesterday















What is it exactly that you have changed in the xml?

– CompactCode
yesterday





What is it exactly that you have changed in the xml?

– CompactCode
yesterday













I'm commenting out the "<referenceContainer name="sidebar.main">" container, so that the "Shop By Category" can be remove from the category view page. (Updated my question with the change i made to the xml file)

– Kris Wen
yesterday







I'm commenting out the "<referenceContainer name="sidebar.main">" container, so that the "Shop By Category" can be remove from the category view page. (Updated my question with the change i made to the xml file)

– Kris Wen
yesterday















See my updated answer

– CompactCode
yesterday





See my updated answer

– CompactCode
yesterday













that works! thanks a lot. still a lot to learn =)

– Kris Wen
yesterday





that works! thanks a lot. still a lot to learn =)

– Kris Wen
yesterday













2














Try to this way...



vendor/magento/module-catalog/view/frontend/layout/catalog_category_view_type_default.xml


to
app/design/frontend/Infortis/ultimo/Magento_Catalog/layout/catalog_category_view_type_default.xml"



Or
open this file app/design/frontend/Infortis/ultimo/Infortis_Ultimo/layout/default.xml



and add below code



<referenceBlock name="sidebar.main" remove="true"/>


Please don't forget to clear cache after change in xml files






share|improve this answer


























  • unfortunately, it doesn't work

    – Kris Wen
    yesterday











  • i have checked my side this is working you have which mode in working ?

    – Rakesh Donga
    yesterday











  • i'm on developer mode. should i switch to another mode?

    – Kris Wen
    yesterday











  • no mate you have created file my follow path? also check which theme you are check again

    – Rakesh Donga
    yesterday













  • yes, i created the file using the path you provided. it's pretty weird issue..

    – Kris Wen
    yesterday
















2














Try to this way...



vendor/magento/module-catalog/view/frontend/layout/catalog_category_view_type_default.xml


to
app/design/frontend/Infortis/ultimo/Magento_Catalog/layout/catalog_category_view_type_default.xml"



Or
open this file app/design/frontend/Infortis/ultimo/Infortis_Ultimo/layout/default.xml



and add below code



<referenceBlock name="sidebar.main" remove="true"/>


Please don't forget to clear cache after change in xml files






share|improve this answer


























  • unfortunately, it doesn't work

    – Kris Wen
    yesterday











  • i have checked my side this is working you have which mode in working ?

    – Rakesh Donga
    yesterday











  • i'm on developer mode. should i switch to another mode?

    – Kris Wen
    yesterday











  • no mate you have created file my follow path? also check which theme you are check again

    – Rakesh Donga
    yesterday













  • yes, i created the file using the path you provided. it's pretty weird issue..

    – Kris Wen
    yesterday














2












2








2







Try to this way...



vendor/magento/module-catalog/view/frontend/layout/catalog_category_view_type_default.xml


to
app/design/frontend/Infortis/ultimo/Magento_Catalog/layout/catalog_category_view_type_default.xml"



Or
open this file app/design/frontend/Infortis/ultimo/Infortis_Ultimo/layout/default.xml



and add below code



<referenceBlock name="sidebar.main" remove="true"/>


Please don't forget to clear cache after change in xml files






share|improve this answer















Try to this way...



vendor/magento/module-catalog/view/frontend/layout/catalog_category_view_type_default.xml


to
app/design/frontend/Infortis/ultimo/Magento_Catalog/layout/catalog_category_view_type_default.xml"



Or
open this file app/design/frontend/Infortis/ultimo/Infortis_Ultimo/layout/default.xml



and add below code



<referenceBlock name="sidebar.main" remove="true"/>


Please don't forget to clear cache after change in xml files







share|improve this answer














share|improve this answer



share|improve this answer








edited yesterday

























answered yesterday









Rakesh DongaRakesh Donga

1,513316




1,513316













  • unfortunately, it doesn't work

    – Kris Wen
    yesterday











  • i have checked my side this is working you have which mode in working ?

    – Rakesh Donga
    yesterday











  • i'm on developer mode. should i switch to another mode?

    – Kris Wen
    yesterday











  • no mate you have created file my follow path? also check which theme you are check again

    – Rakesh Donga
    yesterday













  • yes, i created the file using the path you provided. it's pretty weird issue..

    – Kris Wen
    yesterday



















  • unfortunately, it doesn't work

    – Kris Wen
    yesterday











  • i have checked my side this is working you have which mode in working ?

    – Rakesh Donga
    yesterday











  • i'm on developer mode. should i switch to another mode?

    – Kris Wen
    yesterday











  • no mate you have created file my follow path? also check which theme you are check again

    – Rakesh Donga
    yesterday













  • yes, i created the file using the path you provided. it's pretty weird issue..

    – Kris Wen
    yesterday

















unfortunately, it doesn't work

– Kris Wen
yesterday





unfortunately, it doesn't work

– Kris Wen
yesterday













i have checked my side this is working you have which mode in working ?

– Rakesh Donga
yesterday





i have checked my side this is working you have which mode in working ?

– Rakesh Donga
yesterday













i'm on developer mode. should i switch to another mode?

– Kris Wen
yesterday





i'm on developer mode. should i switch to another mode?

– Kris Wen
yesterday













no mate you have created file my follow path? also check which theme you are check again

– Rakesh Donga
yesterday







no mate you have created file my follow path? also check which theme you are check again

– Rakesh Donga
yesterday















yes, i created the file using the path you provided. it's pretty weird issue..

– Kris Wen
yesterday





yes, i created the file using the path you provided. it's pretty weird issue..

– Kris Wen
yesterday


















draft saved

draft discarded




















































Thanks for contributing an answer to Magento Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f264383%2fmagento-2-override-xml-file-from-vendor-folder-to-app-folder-doesnt-work-updat%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Callistus I

Tabula Rosettana

How to label and detect the document text images