0

I have already override the theme page layout with below files:-

app\design\frontend\[package]\[theme]\Magento_Theme\page_layout\override\base\2columns-left.xml

code is like:-

<?xml version="1.0"?>
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
    <update handle="1column"/>
    <referenceContainer name="columns">
        <container name="div.sidebar.main" htmlTag="div" htmlClass="col-02" after="main">
            <container name="sidebar.main" as="sidebar_main" label="Sidebar Main"/>
            <container name="main" label="Main Content Container"/>         
        </container>
        <container name="div.sidebar.additional" htmlTag="div" htmlClass="col-01" after="div.sidebar.main">
            <container name="sidebar.additional" as="sidebar_additional" label="Sidebar Additional"/>
        </container>
    </referenceContainer>    
</layout>

now all pages showing in 2column left bar.

Now I have installed the magefun blog in my store, all blog pages are also in 2column left bar instead of 2column right bar as defined in the blog's default.xml.

blog's default.xml code:-

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-right" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="sidebar.additional">
            .....
        </referenceContainer>
    </body>
</page>

So Now I want to show all blog page with their default page layout 2column-right and other theme page as their default layout 2column-left.

Please advice.

1

if you want to update the layout from the blog default layout handle from 2columns-right to 2columns-left, you do not need to use the override functionality (which should only be used as a fallback, if you see no other solution).

Normally, you are just extending the original layout and changing what is needed. Using the override directory will completely replace the original layout file.

You can just add the layout file to your theme and set the layout:

app\design\frontend[package][theme]\Blog_Module\layout\frontend\default.xml

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

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.