1

I am trying to create a custom page layout for my theme which is a child of Magento Blank theme. I got the folder structure like this

File: app/design/frontend/Company/themename/Magento_Theme/layouts.xml

  <?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="myfullwidth">
            <label translate="true">Full Width Layout</label>
        </layout>
    </page_layouts> 

File: app/design/frontend/Company/themename/Magento_Theme/page_layout/myfullwidth.xml

<?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>

I am able to see and select the layout in admin area.

However, when I come back to view the page, it displays a blank page. When I view source code of the page, there is nothing inside the body tag.

When I move the the file myfullwidth.xml to vendor/magento/module-themne/view/frontend/page_layout/myfullwidth.xml then it works fine.

Look like Magento didn't recognize the file when I place it under the page_layout folder in my theme folder. Anyone knows what have I done wrong? Thank you for your help in advance.

P/S: I have cleared cache and run setup:status-content:deploy but it doesn't make any different.

2
  • Hi. I've got the exact same issue. Any luck solving it? – sulman May 8 '17 at 10:22
  • Unfortunately not but I have solved my problem using block. I inserted a block right after the menu to display full-width content – Ty Trinh May 30 '17 at 0:20

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.