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!

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 – Dava Gordon Jan 28 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 👍 – 00-BBB Jan 28 at 15:56
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

1
  • Note: I do also have to create a custom module to set the admin theme. ( ...a whole module required just to do that...!!? ):/ – 00-BBB Feb 1 at 9:58
1

please try:-

override view.xml in your theme

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

3
  • Is there a way to override this in /app/code/Vendor/CustomModule/ ? – 00-BBB Jan 26 at 9:26
  • please try. override view.xml /app/code/Vendor/CustomModule/etc/view.xml – Himanshu Jan 26 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) – 00-BBB Jan 26 at 15:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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