Hi Andreas, so you have a cropper property directly on your doc type? Then it makes sense that that is all that gets stored since you aren't using a media picker...
You could change the media type, to use cropper instead of upload for it's images, then use a media picker on your doc type, that will store the id and you will be able to fetch the name then
I added an new Media type with the image cropper.
But if I use a media picker in my doc type, I can't choose which media type it has to use, so there is no cropper in the document editor.
Sorry should have been a bit more specific, you don't need to add a new media type but change the existing media type, change the property umbraco file to imagecropper instead of upload (if it isn't already)
Get media name from cropped image
Hi everyone,
I'm a little while working with Umbraco for now. New to the forums :)
I've a templating problem with the Cropped Image DataType. How can I get the media's name?
The only thing I get from the property is:
How can I get the other media properties like it's name?
Comment author was deleted
Hi Andreas, so you have a cropper property directly on your doc type? Then it makes sense that that is all that gets stored since you aren't using a media picker...
Hi Tim,
Yeah that's what I do. Is there an alternative?
The backend user must crop the image.
Thanks, Andreas Furster
Comment author was deleted
You could change the media type, to use cropper instead of upload for it's images, then use a media picker on your doc type, that will store the id and you will be able to fetch the name then
I don't get this right.
I added an new Media type with the image cropper. But if I use a media picker in my doc type, I can't choose which media type it has to use, so there is no cropper in the document editor.
What am I missing?
Comment author was deleted
Sorry should have been a bit more specific, you don't need to add a new media type but change the existing media type, change the property umbraco file to imagecropper instead of upload (if it isn't already)
You mean the default image media type? That it's an image cropper already.
And if I add a crop size there, all media pickers will use that right? That's not what I want.
Comment author was deleted
Ok think I misunderstood your question, you just want to output the alt text for an image you get from the cropper I suppose?
Yeah, you'r right! I'm sorry I did not note that.
Comment author was deleted
Well if the image cropper doesn't provide you the name you could just add a new property to hold that no?
Yeah, I could. But then i've to do this for every image. (About 20 in the document type)
But why if the media type already contains a name? I noticed I could even use regex on
"src": "/media/1071/stack.png",
to get the media id.I was just wondering if there wasn't an more efficient way of getting the id or name.
is working on a reply...