4

I want to change layout of category listing page from 2columns-left to 1column by xml.

for this what i have tried so far.

In root\magento-ce-2.0.0\vendor\magento\module-catalog\view\frontend\layout\catalog_category_view.xml

I changed

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

to

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

but this is not working, whereas if i change Page Layout of category from admin of then changes reflecting but i don't want to make changes from admin i want it from xml.

Can any one please help me for this.

  • Any solution for this? I have the same problem. – chdzma Apr 10 '19 at 11:27
  • Create custom module with sequence or override it in your theme. – Ashish Madankar M2 Professiona Apr 10 '19 at 13:32
6

May be other module rewrite that layout please check other module not conflict with it.

It is bad habit to edit core files create module and add file to

app/code/Vendor/Modulename/view/frontend/layout/catalog_category_view.xml

add below code to file:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head></head>
    <body></body>
</page>
  • Thanks for the answer firstly this is my fresh installation and their is no other module in it. and i am making changes in core file for just confirmation once i get working then i will revert all my changes and create my own module. Any ways i have create a module which override this layout and its working. But why core file not reflecting changes can you please tell me. – Ashish Madankar M2 Professiona Jun 15 '16 at 13:03

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.