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.

2
  • Any solution for this? I have the same problem.
    – chdzma
    Commented Apr 10, 2019 at 11:27
  • Create custom module with sequence or override it in your theme. Commented Apr 10, 2019 at 13:32

1 Answer 1

8

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>
1
  • 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. Commented Jun 15, 2016 at 13:03

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.