Question

I created a new custom page_layout that I want to make full width.

My fullwidth-layout.xml file looks currently like this. But I want to make the main content full width. So that I can set this layout for some cms pages.

I want to keep the header and footer as default, but only the main content of the specific CMS page full width.

How can I achieve this?

<?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="empty"/>
    <referenceContainer name="page.wrapper">
        <container name="header.container" as="header_container" label="Page Header Container"  htmlTag="header" htmlClass="page-header" before="main.content"/>
        <container name="page.top" as="page_top" label="After Page Header" after="header.container"/>
        <container name="footer-container" as="footer" before="before.body.end" label="Page Footer Container" htmlTag="footer" htmlClass="page-footer" />
    </referenceContainer>
</layout>
Was it helpful?

Solution

You can achieve it by using CSS, So please create a fullwidth layout and set custom width to your header and footer block using CSS.

You can create custom full-width layout using following url :
https://inchoo.net/magento-2/magento-2-custom-cms-page-layout/

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top