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 ?
1 Answer 1
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