Guide on how to customize the image/upload field #2154
johannesschaffer
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to implement an image cropper into the CMS, so the uploaded images can be cropped by the user directly . While Payload doesn't have this built-in, it does support swapping in custom UI components. The API with the "useField()" hooks is very nice, however specifically in the case of the Upload field it's unclear what exactly to set via the "setField()" returned from "useField()".
Also, is it possible to extend it with custom properties that can be queried by the website (e.g. saving the crop as property rather than applying it directly to the image, in case I want to save multiple crops)?
I know the image api can crop images on the fly, however my use case is that I display images with a certain aspect ratio on my website und the user should be able to preview uploaded images with that aspect ratio and set the focal point to their liking.
I find the documentation a bit sparse on the subject of custom fields, especially regarding upload & media library. It would be great if a guide could be provided sometime in the future 🚀
Beta Was this translation helpful? Give feedback.
All reactions