15/08/2022
We use cookies to make your experience better. To comply with the new e-Privacy directive, we need to ask for your consent to set the cookies. Learn more.
We use cookies to make your experience better. To comply with the new e-Privacy directive, we need to ask for your consent to set the cookies. Learn more.
Follow the following steps to extend the layout in Magento 2
Add extending page configuration or generic layout file
<theme_dir>
|__/<Namespace>_<Module>
|__/layout
|--<layout1>.xml
|--<layout2>.xml
For example, to customise/extend the layout.
<Magento_Catalog_module_dir>/view/frontend/layout/catalog_product_view.xml
Add extending page layout file
For extending the page layout, follow this path.
<theme_dir>
|__/<Namespace>_<Module>
|__/page_layout
|--<layout1>.xml
|--<layout2>.xml
<layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<handle id="checkout_cart_index" label="Shopping Cart" type="page" parent="default">
<!-- Layout instructions from checkout_cart_index.xml -->
</handle>
<handle id="checkout_onepage_index" label="One Page Checkout" type="page" parent="default">
<!-- Layout instructions from checkout_onepage_index.xml -->
</handle>
<!-- ... -->
</layouts>
If you are looking for Magento Developers, visit Magento Developer Agency.