This repository was archived by the owner on Nov 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Added instruction to add new page layout #6532
Merged
dobooth
merged 7 commits into
magento:master
from
ajithkumar-maragathavel:layout-creation
Feb 18, 2020
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c8363b3
Added instruction to add new page layout
ajithkumar-maragathavel 5cb50b1
Changed example as 3-column-double-footer
ajithkumar-maragathavel c6d052a
Minor layout adjustments
rogyar 4c7bd17
commit the changes requested
ajithkumar-maragathavel fb5085e
Merge branch 'layout-creation' of https://github.com/ajithkumar-marag…
ajithkumar-maragathavel 44d877d
Table of content is updated for a new page
ajithkumar-maragathavel a27ba42
Merge branch 'master' into layout-creation
dobooth File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/guides/v2.3/frontend-dev-guide/layouts/layout-create.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
group: frontend-developer-guide | ||
title: Create a new layout | ||
functional_areas: | ||
- Frontend | ||
--- | ||
|
||
## Create a new page layout in custom theme | ||
|
||
If an existing page layout does not meet your requirements, then you can create a new page layout in Magento. | ||
|
||
For example, if a new page is going to be designed as `3-columns-double-footer` layout, you may create the new layout in the following way. Create a custom page-layout XML file in following directory `app/design/frontend/<VendorName>/<ThemeName>/Magento_Theme/page_layout/3-columns-double-footer.xml`. | ||
|
||
```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="3columns"/> | ||
<referenceContainer name="page.wrapper"> | ||
<container name="footer-bottom" as="footer-bottom" after="-" label="Footer Bottom" htmlTag="footer" htmlClass="page-footer-bottom"/> | ||
</referenceContainer> | ||
</layout> | ||
``` | ||
|
||
## Add the new layout to the layouts.xml file | ||
|
||
Add the newly created page layout to the `layouts.xml` file of the theme directory `app/design/frontend/<VendorName>/<ThemeName>/Magento_Theme/layouts.xml`. | ||
|
||
```xml | ||
<?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="3-columns-double-footer"> | ||
<label translate="true">3 Columns Double Footer</label> | ||
</layout> | ||
</page_layouts> | ||
``` |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.