4

This question already has an answer here:

The overrides structure that I have made for custom theme is (based on Blank):

app > design > frontend > Magento > gc>Magento_Theme > templates

It's now possible to override phtml file.

Now I would like to make a custom layout.

for app > design > frontend > Magento > gc > Magento_Theme > layouts.xml.

I edited the file with:

<?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="1column">
        <label translate="true">1 column</label>
    </layout>
    <layout id="2columns-left">
        <label translate="true">2 columns with left bar</label>
    </layout>
    <layout id="2columns-right">
        <label translate="true">2 columns with right bar</label>
    </layout>
    <layout id="3columns">
        <label translate="true">3 columns</label>
    </layout>
    <layout id="home-gc">
        <label translate="true">home-gc</label>
    </layout>

</page_layouts>

In app > design > frontend > Magento > gc > Magento_Theme > page_layouts I have made home-gc.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"/>
    </referenceContainer>
</layout>

The home-gc page-layout can be select in CMS > content > pages > design > layout but the homepage is printing out empty.

Which way is best to make a custom page-layout?

marked as duplicate by Raphael at Digital Pianism, mbalparda, Fabian Schmengler, Anna Völkl, Amit Bera Mar 11 '16 at 17:39

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2

In app>design>frontend>Magento>gc>Magento_Theme add layouts.xml

<?xml version="1.0" encoding="UTF-8"?>
<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/View/PageLayout/etc/layouts.xsd">

<layout id="custom_home">
<label translate="true">custom_home</label>
</layout>

</page_layouts>

Copy from core vendor the map page_layout to app>design>...>Magento_Theme> Copy/paste one of the page layouts and change the name to custom_home.xml Go to the CMS>Pages>Theme Now you can see the custom_home. Select it.

Changing the structure is possible in the default.xml

Not the answer you're looking for? Browse other questions tagged or ask your own question.