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

Commit 8e4453f

Browse files
authored
Merge pull request #8694 from Santoshziffity/theme-inheritance-layout-files-order-2796
change layout file order
2 parents 196476b + 7327c20 commit 8e4453f

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/guides/v2.3/frontend-dev-guide/themes/theme-inherit.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ For comprehensive information about developing theme components, see subsequent
2323
A parent theme is specified in the child theme `theme.xml` declaration file.
2424

2525
Example:
26-
The Orange theme by SampleCompany inherits from the Magento Blank theme. The inheritance is declared in `app/design/frontend/SampleCompany/orange/theme.xml` as follows:
26+
The Orange theme by ExampleCorp inherits from the Magento Blank theme. The inheritance is declared in `app/design/frontend/ExampleCorp/orange/theme.xml` as follows:
2727

2828
```xml
2929
<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
@@ -130,13 +130,13 @@ You can find out what exactly code changes are required to perform this and othe
130130

131131
The layouts processing mechanism does not involve fallback. The system collects [layout](https://glossary.magento.com/layout) files in the following order:
132132

133-
1. All modules layout files in sequence defined in `app/etc/config.php` respecting the [component load order]({{ page.baseurl }}/extension-dev-guide/build/module-load-order.html). For each module:
133+
1. Current theme layouts: `<theme_dir>/<Vendor>_<Module>/layout/`
134134

135-
* Layout files for the `base` area: `<module_dir>/view/base/layout/`
136-
* Layout files for the `frontend` area: `<module_dir>/view/frontend/layout/`
135+
1. Ancestor theme layouts, starting from the most distant ancestor, recursively until a theme with no parent is reached: `<parent_theme_dir>/<Vendor>_<Module>/layout/`
137136

138-
1. Ancestor theme layouts, starting from the most distant ancestor, recursively until a theme with no child is reached: `<parent_theme_dir>/<Vendor>_<Module>/layout/`
139-
1. Current theme layouts: `<theme_dir>/<Vendor>_<Module>/layout/`
137+
1. All module layout files in sequence, defined in `app/etc/config.php` respecting the component load order. For each module:
138+
* Layout files for the `base` area: `<module_dir>/view/base/layout/`
139+
* Layout files for the `frontend` area: `<module_dir>/view/frontend/layout/`
140140

141141
Unlike templates or images, layout can be not only overridden, but also extended. And the recommended way to customize layout is to extend it by creating theme extending layout files.
142142

@@ -146,13 +146,13 @@ To add an extending layout file:
146146

147147
**Example:**
148148

149-
SampleCompany decided they should remove the "Report bugs" link from the footer, defined in `<Magento_Theme_module_dir>/view/frontend/layout/default.xml`
150-
To do this, they added an extending layout in `app/design/frontend/SampleCompany/orange/Magento_Theme/layout/default.xml` :
149+
ExampleCorp decided they should remove the "copyright" from the footer, defined in `<Magento_Theme_module_dir>/view/frontend/layout/default.xml`
150+
To do this, they added an extending layout in `app/design/frontend/ExampleCorp/orange/Magento_Theme/layout/default.xml` :
151151

152152
```xml
153153
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
154154
<body>
155-
<referenceBlock name="report.bugs" remove="true"/>
155+
<referenceBlock name="copyright" remove="true"/>
156156
</body>
157157
</page>
158158
```

0 commit comments

Comments
 (0)