1

I want to create a page with a custom layout but it doesn't respond to my changes. I'm trying to remove the header within this page.

I've added layouts.xml to ../app/design/frontend/themevendor/theme/Magento_Theme:

<?xml version="1.0" encoding="UTF-8"?>
<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/PageLayout/etc/layouts.xsd">
    <layout id="sample_page">
        <label translate="true">Sample Page layout</label>
    </layout>
</page_layouts>

I also added sample_page.xml to < the same directory >/page_layout:

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

But removing the 'header.container' container or adding remove='true' doesn't remove the header from that page. If I want to remove the header OR make a custom header for this page, how would I do this?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.