0

I can't get a custom page template to work in my custom theme. All I'm getting is a blank page. No header, footer, page content, nothing. I have created the following files in my custom theme:

/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="custom_home">
        <label translate="true">Custom Home</label>
    </layout>

</page_layouts>

/Magento_Theme/page_layouts/custom_home.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 can see the new page template in the admin area and have assigned it to my page. I can also see the template name added as a class in the body, but other than that it's just a blank white page.

I'm using Magento 2.2.5. Parent theme is Blank.

2
  • <update handle="empty"/> should be "1column" Commented Jul 31, 2018 at 18:10
  • @AbhishekPanchal I have also tried it with that and had no success. I still get a blank page.
    – Jack
    Commented Aug 1, 2018 at 7:40

1 Answer 1

-1

I realized that the page_layouts folder in my theme should have been page_layout once I changed that everything worked as it should.

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.