Mediapicker3 make crops discoverable #10442
Replies: 2 comments 1 reply
-
I remember there is a package (or at least a GitHub solution) that would generate constants based on your crops. I wonder if we could add the logic of that to the Umbraco project. If only I could find that package again.. |
Beta Was this translation helpful? Give feedback.
-
I've discussed something very similar on a Models Builder issue: modelsbuilder/ModelsBuilder.Original#215. Would be great if MB could be extended to generate additional constants based on the data type configuration (where the crop aliases are stored). One major improvement in the new Media Picker is the possibility to define a label and alias per crop, so you at least don't have to change a lot of code to update the name of a crop (as is still the case with the Image Cropper). And keep in mind: nothing stops you from defining and structuring your own constants. Better yet: if you start manually doing this, the lessons learnt can be directly applied when creating this feature 😉 |
Beta Was this translation helpful? Give feedback.
-
The mediapicker v3 works really nice.
The only issue I have with it is that it introduces a lot of strings into the code.
It would be great if we could generate a property for example a enum maybe with modelsbuilder to make the crops discoverable.
Now I have to go into Umbraco to look up the image crop alias every time.
It would be awesome if we could do something like:
mediaItem.GetLocalCropUrl(LocalClops.Thumbnail);
Beta Was this translation helpful? Give feedback.
All reactions