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).


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

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

1 Answer 1


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, 2019 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, 2019 at 9:39

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.