Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit f2f286a

Browse files
authored
Merge pull request #8686 from ajithkumar-maragathavel/layout-extend
Examples added on layout extend page
2 parents 11c27d1 + 2643d86 commit f2f286a

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

src/guides/v2.3/frontend-dev-guide/layouts/layout-extend.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,17 @@ To add an extending [page configuration]({{ page.baseurl }}/frontend-dev-guide/l
2020
|--<layout2>.xml
2121
```
2222
23-
For example, to customize the layout defined in `<Magento_Catalog_module_dir>/view/frontend/layout/catalog_product_view.xml`, you need to add a layout file with the same name in your custom theme, such as: `<theme_dir>/Magento_Catalog/layout/catalog_product_view.xml`
23+
For example, to customize the layout defined in `<Magento_Catalog_module_dir>/view/frontend/layout/catalog_product_view.xml`, you need to add a layout file with the same name in your custom theme, such as: `<theme_dir>/Magento_Catalog/layout/catalog_product_view.xml`. Then do your customizations on the layout xml.
24+
25+
**Example:**
26+
27+
```xml
28+
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
29+
<body>
30+
<move element="product.info.stock.sku" destination="product.info.price" after="product.price.final"/>
31+
</body>
32+
</page>
33+
```
2434

2535
To add an extending [page layout]({{ page.baseurl }}/frontend-dev-guide/layouts/layout-types.html#layout-types-page) file:
2636

@@ -33,6 +43,19 @@ To add an extending [page layout]({{ page.baseurl }}/frontend-dev-guide/layouts/
3343
|--<layout2>.xml
3444
```
3545
46+
For example, to customize the page layout defined in `<Magento_Theme_module_dir>/view/frontend/page_layout/1column.xml`, you need to add a page layout file with the same name in your custom theme, such as: `<theme_dir>/Magento_Theme/page_layout/1column.xml`. Then do your customizations on the page layout xml.
47+
48+
**Example:**
49+
50+
```xml
51+
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
52+
<update handle="empty"/>
53+
<referenceContainer name="page.wrapper">
54+
<container name="page.top.after" label="After Page Top" after="page.top"/>
55+
</referenceContainer>
56+
</layout>
57+
```
58+
3659
## Processing extending layouts
3760

3861
Magento merges layout files as follows:

0 commit comments

Comments
 (0)