I am creating a Custom form in admin of magento 2,and I want to add media gallery for same product form(Images and video Tab https://prnt.sc/w926fk ) into this form https://prnt.sc/w928bi

please help me with this issue . Thank much!

1 Answer 1


First you check magenot 2 default xml file like :- vendor/magento/module-catalog/view/adminhtml/ui_component/product_form.xml and check magento default code

enter image description here

And same as edit code in your custom module.And Below links is helpful

Please can your try this link :-



If any query Please ask me.


  • I was able to add the "Images And Videos" on my custom form, but why current images was not added on the gallery even if my product has current images and also I used product collection. Also tried adding "->addMediaGalleryData()" on the collection but still no images. Commented Jun 13, 2023 at 2:52

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.