Magento – Custom page layout not working

layoutmagento2

Im going crazy here. Can't get this to work. I'd like to make a custom page layout like the 1column, 2columns-left etc.
I've searched and read multiple tutorials all doing the same. Nothing works though. I've got the below code. Am I overlooking something maybe?

Many thanks if you guys could help me with this.


Vendor: Experius

Theme: aras


* Step 1: Define custom page layout:*

app/design/frontend/Experius/aras/Magento_Theme/layouts.xml

<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/PageLayout/etc/layouts.xsd">
    <layout id="splash-page">
        <label translate="true">Splash page</label>
    </layout>
</page_layouts>

Step 2: Define page layout of custom page layout

app/design/frontend/Experius/aras/Magento_Theme/page_layout/splash-page.xml

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
    <update handle="empty"/>
</layout>

Step 3: Add new block to custom page layout page wrapper container

app/design/frontend/Experius/aras/Magento_Theme/layout/default.xml

<?xml version="1.0"?>
<page layout="splash-page" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <referenceContainer name="page.wrapper">
        <block class="Magento\Framework\View\Element\Template" before="-" name="splash.backgroundimage.container" template="Experius_ContentPage::html/backgroundimage-container.phtml" />
    </referenceContainer>
</page>

Best Answer

You probably have to add your code in the splash-page.xml file

app/design/frontend/Experius/aras/Magento_Theme/page_layout/splash-page.xml

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<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">
        <block class="Magento\Framework\View\Element\Template" before="-" name="splash.backgroundimage.container" template="Experius_ContentPage::html/backgroundimage-container.phtml" />
    </referenceContainer>
</layout>