1

By default Magento 2 creates more than 20 duplicates of each product image..! (why???)

I have got this down to 5 using view.xml in my theme, but there is one extra set of image sizes I need to change, these are set in

/vendor/magento/theme-adminhtml-backend/etc/view.xml.

They are: product_listing_thumbnail, product_listing_thumbnail_preview, product_thumbnail_image.

I want to update it using my custom module. I have it at this path

app/code/Vendor/Module/view/adminhtml/etc/view.xml.

But this is wrong. Is there a correct path that will work? (If creating an admin theme is the only way then I guess I could do that, but seems overkill for just one small change).

(Have spent ages looking online and through docs but can only find info for frontend view.xml, which I am already using, and putting the image names in this file does not work).

Many Thanks!

Savan Patel
2,4541 gold badge19 silver badges43 bronze badges
asked Jan 19, 2021 at 12:25
2
  • 1
    This cannot be done using a custom module as the file is theme specific. if you update your theme etc/view.xml and include the additional elements this should create the additional required images you need Commented Jan 28, 2021 at 15:37
  • @DavaGordon Yes I think you are correct it cannot be done from a custom module as it is a 'theme file'. So it must be done by creating a new custom admin theme. If you post as an answer I will accept πŸ‘ Commented Jan 28, 2021 at 15:56

2 Answers 2

1
+50

This cannot be done using a custom module as the file is theme specific. if you update your theme etc/view.xml and include the additional elements this should create the additional required images you need

answered Jan 29, 2021 at 10:54
1
  • Note: I do also have to create a custom module to set the admin theme. ( ...a whole module required just to do that...!!? ):/ Commented Feb 1, 2021 at 9:58
1

please try:-

override view.xml in your theme

path:- app/design/adminhtml/Vander/your-them/etc/view.xml

answered Jan 26, 2021 at 9:16
3
  • Is there a way to override this in /app/code/Vendor/CustomModule/ ? Commented Jan 26, 2021 at 9:26
  • please try. override view.xml /app/code/Vendor/CustomModule/etc/view.xml Commented Jan 26, 2021 at 12:04
  • Hmm no sorry that path didn't work :(, the images are still being resized to 75x75 as set in '/vendor/magento/theme-adminhtml-backend/etc/view.xml'. (after adding view.xml to new path I did setup:upgrade, cache clean, manually cleared product image cache, and ran catalog:images:resize) Commented Jan 26, 2021 at 15:17

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.