1

I wish to add a new image id for a custom product widget.

I know I can do this with the file view.xml in my theme but I would like to do this in the Module (app/code/vendor/module).

https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/themes/theme-images.html

<images module="Magento_Catalog">
    <image id="unique_image_id" type="image_type">
    ...
    </image>
<images/>

Is it possible to do this in a module, with no theme ?

1
+50

Yes you can.
You can create the etc/view.xml file in one of your modules and it should be picked up.
Take as example the etc/view.xml file from Magento_Swatch module.

  • Did you find this only in the code ? or is there a reference in the doc ? – Taschert May 2 at 9:36
  • I found it in the code. and a long time ago I tried to create my own entity that supported images and I had to do the same. – Marius May 2 at 9:39

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.