You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my custom media model, I would like to allow my users to select their thumbnails from their existing image library. While it's possible to override the "thumbnail" field with the wagtailimages model, it does not look like it is possible to enable the ImageChooserPanel widget on the edit form (therefore making it impossible to choose an image/actually use the image model).
I understand this may be more of a limitation of Wagtail than of this package, since Wagtail does not allow you to specify a widget under admin_form_fields. (See wagtail/wagtail#2610)
Would it be possible to provide an override the "widgets" object under get_media_form in forms.py?
Given #83 (and a fix in #147) allow you to use your own media form, let's treat this as a documentation piece (i.e. "here's how to use Wagtail image for the thumbnail")
We had to create a custom image chooser which links to a few Wagtail JS files to get this working, so we might need to hold off on documenting this until the front-end changes land upstream. Here is an example of what we did:
I'd have to dig through my notes but my recollection is that AdminImageChooser implicitly relies on JS files already loaded in the Wagtail admin templates, so we had to explicitly load these files to get it to work. Obviously, if we did this the hard way, happy to learn of a simpler approach! And equally happy to work on a PR to document this the "right" way once that has been defined upstream. Thanks!
In my custom media model, I would like to allow my users to select their thumbnails from their existing image library. While it's possible to override the "thumbnail" field with the wagtailimages model, it does not look like it is possible to enable the ImageChooserPanel widget on the edit form (therefore making it impossible to choose an image/actually use the image model).
I understand this may be more of a limitation of Wagtail than of this package, since Wagtail does not allow you to specify a widget under
admin_form_fields
. (See wagtail/wagtail#2610)Would it be possible to provide an override the "widgets" object under
get_media_form
informs.py
?For example:
Then in my custom model:
The text was updated successfully, but these errors were encountered: