QuestionQ2

Adobe Experience Manager Sites

An Adobe Commerce developer needs to override the template assigned to a block named existing.product.block. This relationship is defined in the catalog_product_view.xml layout of the Magento_Catalog module. They cannot merely override the file in their theme because the change belongs to a feature being released to the marketplace as a module named Orange_CustomProduct.

The developer has already created the required template at app/code/Orange/CustomProduct/view/frontend/templates/custom-product-block.phtml.

What can they add to app/code/Orange/CustomProduct/view/frontend/layout/catalog_product_view.xml in their module to achieve this?

  • A
  • B
  • C
  • D
Explanation

A referenceBlock targets the existing block, and an arguments node containing a string argument named template assigns its template declaratively. The identifier Orange_CustomProduct::custom-product-block.phtml resolves to the module’s view/frontend/templates/custom-product-block.phtml file. Adobe Commerce documents the template argument as a supported way to set a block template and recommends arguments over an <action> call when the block API permits it.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!