AD0-E720 practice question 8 of 10

An Adobe Commerce developer wants to remove the default Wishlist and Compare Products blocks on a category page with layered navigation Where would this modification be placed, assuming the developer only wants to make this change?

Full set: 50 questions
Answer options
A: app/design/frontend/Vendor/Theme/Magento_LayeredNavigation/layout/override/catalog_categor y_view_type_layered.xml
B: app/design/frontend/Vendor/Theme/Magento_Layered.Navigation/layout/catalog_category_view_t ype_layered.xml Correct answer
C: app/design/frontend/Vendor/Theme/Magento_Catalog/layout/catalog_category_view.xml
Correct Answer:
B. app/design/frontend/Vendor/Theme/Magento_Layered.Navigation/layout/catalog_category_view_t ype_layered.xml
Explanation

The question requires removing blocks specifically from category pages where layered navigation is active. Adobe Commerce uses a specific layout handle for this scenario: catalogcategoryviewtypelayered. To apply a layout modification for this specific view, a developer must create an extending layout file named catalogcategoryviewtypelayered.xml within their theme. This file allows for targeted changes, such as removing blocks using , that apply only to layered navigation category pages, fulfilling the requirement.
Note: While this option correctly identifies the specific layout file, the module directory path is technically incorrect. The catalogcategoryviewtypelayered.xml layout originates from the MagentoCatalog module, so the correct path should be within the MagentoCatalog directory. However, among the given choices, this is the only one that uses the correct, most specific layout file name.

Why Incorrect

A. The override directory is used to completely replace a base layout file from a parent theme or module, which is an unnecessarily drastic action for simply removing a block.
C. Using catalogcategoryview.xml is incorrect because it is too broad. This file would apply the changes to all category pages, not just those with layered navigation as specified.

References

1. Adobe Commerce Developer Documentation, Frontend Developer Guide, Layouts, Layout file types: This document specifies the convention for extending layouts. An extending layout file must be placed in app/design/frontend////layout/. The corresponds to the module where the original layout file is located.

Reference: Adobe Commerce Documentation > Frontend Developer Guide > Theming > Layouts > Layout file types.

2. Magento Open Source Codebase: The original layout file that defines the catalogcategoryviewtypelayered handle is located in the MagentoCatalog module.

Reference: vendor/magento/module-catalog/view/frontend/layout/catalogcategoryviewtypelayered.xml. This file's existence and location confirm that any extension should be placed in the theme's MagentoCatalog/layout directory.

3. Adobe Commerce Developer Documentation, Frontend Developer Guide, Layouts, Common layout customization tasks: This section details how to remove blocks using layout XML. The instruction is the standard method used within an extending layout file like catalogcategoryviewtypelayered.xml.

Reference: Adobe Commerce Documentation > Frontend Developer Guide > Theming > Layouts > Common layout customization tasks > Remove a block.

Scroll to Top