AD0-E720 practice question 10 of 10

An Adobe Commerce developer wants to override the following Layout XML file in the theme ExampleCorp/orange. app/design/frontend/ExampleCorp/blank/Vendor_Module/layout/catalog_product_view.xml What path would the developer use inside the layout directory of the theme to override the file?

Full set: 50 questions
Answer options
A: /override/ExampleCorp/blank/catalog_product_view.xml
B: /override/theme/ExampleCorp/blank/catalog_product_view.xml
C: /catalog_product_view.xml Correct answer
Correct Answer:
C. /catalog_product_view.xml
Explanation

To override a layout XML file from a module or a parent theme, Adobe Commerce requires creating a file with the exact same name in the corresponding path within the target theme's directory. The original file is located at app/design/frontend/ExampleCorp/blank/VendorModule/layout/catalogproductview.xml. To override this in the ExampleCorp/orange theme, the new file must be placed at app/design/frontend/ExampleCorp/orange/VendorModule/layout/catalogproductview.xml. The question asks for the path inside the layout directory (.../VendorModule/layout/), which is simply the filename itself: catalogproductview.xml.

Why Incorrect

A. The override directory is not used for replacing layout files via this method; it is used for extending layouts or overriding templates, not for a direct file replacement of a layout XML.
B. The override/theme directory is used for extending a specific theme's layout files, not for a direct file replacement as required by the scenario.

References

1. Adobe Commerce Developer Documentation, Frontend Developer Guide, Layouts, Override a layout:

Section: Override a module layout: "To override a module layout, you need to put the layout file in the following location: //layout/.xml". This confirms the required directory structure for the overriding file.

Section: Override a theme layout: "To override a theme layout, you need to put the layout file in the following location: //layout/.xml". This shows the same principle applies when overriding a file that already exists in another theme. The path relative to the theme root must be identical. This supports that the new file is catalogproductview.xml placed inside the .../VendorModule/layout/ directory.

Scroll to Top