1

I am new to magento 2 and i am trying to figure out what i am doing wrong when trying to make a custome layout for the homepage.

I have the following structure

let $themPath = app/design/frontend/VendorName/themeName

In $themPath/layouts.xml i added the following:

<layout id="my-home">
 <label translate="true">my-home</label>
</layout>

I added $themPath/Magento_Theme/page_layouts/my-home.xml with the content copied from 1column.xml. No changes

I ran

1) rm -rf var/
2) rm -rf pub/static/frontend/VendorName/*
3) bin/mangento setup:upgrade
4) bin/magento cache:clean

After i reload the admin interface, go to content->Pages, edit homepage and i still don't see the my-home layout available in the dropdown for homepage

What am i doing wrong ?

asked Jul 10, 2018 at 14:26
0

1 Answer 1

0

Use below code on your layouts.xml and place that under

app/design/frontend/[Vendor]/[theme]/Magento_Theme/

<?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="my-home">
 <label translate="true">my-home</label>
 </layout>
</page_layouts>

And create page_layout folder under and create my-home.xml under it like below:

app/design/frontend/[Vendor]/[theme]/Magento_Theme/page_layout/my-home.xml

answered Jul 10, 2018 at 14:34

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.