Skip to content

Latest commit

 

History

History
77 lines (57 loc) · 3.58 KB

layout-extend.md

File metadata and controls

77 lines (57 loc) · 3.58 KB
layout group subgroup title menu_title menu_order version github_link redirect_from
default
fedg
B_Layouts
Extend a layout
Extend a layout
4
2.0
frontend-dev-guide/layouts/layout-extend.md
/guides/v1.0/frontend-dev-guide/layouts/layout-extend.html

Create a theme extending file

Rather than copy extensive page layout or page configuration code and then modify what you want to change, in the Magento system, you only need to create an extending layout file that contains the changes you want.

To add an extending page configuration or generic layout file:

  1. Put the layout file in the following location:
<theme_dir>
 |__/<Namespace>_<Module>
   |__/layout
     |--<layout1>.xml
     |--<layout2>.xml

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, like following:

<theme_dir>/Magento_Catalog/layout/catalog_product_view.xml

To add an extending page layout file:

  1. Put the file in the following location:
<theme_dir>
 |__/<Namespace>_<Module>
   |__/page_layout
     |--<layout1>.xml
     |--<layout2>.xml

Related topics: