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


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"/>

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?


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>


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

| improve this answer | |

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