2

How can I override vendor/magento/module-ui/view/base/ui_component/templates/listing/default.xhtml in a theme? In this instance it's for the recently viewed products widget.

This is added here - vendor/magento/module-ui/view/base/ui_component/etc/definition.xml:10

<listing sorting="true" class="Magento\Ui\Component\Listing" component="uiComponent">
    <argument name="data" xsi:type="array">
        <item name="template" xsi:type="string">templates/listing/default</item>
        <item name="save_parameters_in_session" xsi:type="string">1</item>
        <item name="client_root" xsi:type="string">mui/index/render</item>
    </argument>
</listing>

1 Answer 1

1

To do this add the file to your theme excluding view/base/.

Like this - app/design/frontend/StoreName/ThemeName/Magento_Ui/ui_component/templates/listing/default.xhtml

After flushing cache it works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.