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!
-
1This 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 needDava Gordon– Dava Gordon2021εΉ΄01ζ28ζ₯ 15:37:59 +00:00Commented 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 π00-BBB– 00-BBB2021εΉ΄01ζ28ζ₯ 15:56:37 +00:00Commented Jan 28, 2021 at 15:56
2 Answers 2
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
-
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– 00-BBB2021εΉ΄02ζ01ζ₯ 09:58:12 +00:00Commented Feb 1, 2021 at 9:58
please try:-
override view.xml in your theme
path:- app/design/adminhtml/Vander/your-them/etc/view.xml
-
Is there a way to override this in /app/code/Vendor/CustomModule/ ?00-BBB– 00-BBB2021εΉ΄01ζ26ζ₯ 09:26:21 +00:00Commented Jan 26, 2021 at 9:26
-
please try. override view.xml /app/code/Vendor/CustomModule/etc/view.xmlHimanshu– Himanshu2021εΉ΄01ζ26ζ₯ 12:04:03 +00:00Commented 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)00-BBB– 00-BBB2021εΉ΄01ζ26ζ₯ 15:17:46 +00:00Commented Jan 26, 2021 at 15:17
Explore related questions
See similar questions with these tags.