I know this question has been asked before but I can't seem to get it to work properly. I've tried several examples but I can't seem to get past the { focalpoint ... output.
I'm using Umbraco 7.1, rendering engine WebForms.
I've tried 2 approaches both with the same result.
First approach:
I've created a new Image Cropper datatype called "Picture Cropper" with a crop called "cropPicture". Next I've created a property on a DocumentType called "picture" of type "Picture Cropper".
Using razor I retrieve the image data as a string: @node.picture. I've also tried several options like @node.GetCropUrl("picture", "cropPicture"); I've also tried it without the first parameter and I've tried it with propertyAlias: picture, cropAlias: cropPicture.
Second approach using MediaPicker:
I've added a crop called "cropPicture" to the default Image Cropper. Next I've created a new Media Type called "Media Image Cropper" with a property called "picture" of type "Image Cropper". Next I add a MediaPicker property called "picture" on a DocumentType. In Razor I type: dynamic media = Media.MediaById(node.picture) which gives me a long string with focalpoint and crops. I've also tried @media.crops.Find("picture", "cropPicture") but this does not work either.
What are the steps one should take when one has the image data as a string?
It sounds like you have it setup correctly, however I think your issue is that you are using a Razor Macro with DynamicNode which are now legacy, instead you should be using Partial View Macros, then the GetCropUrl method would be working.
How to get the url of cropped image
Hi,
I know this question has been asked before but I can't seem to get it to work properly. I've tried several examples but I can't seem to get past the { focalpoint ... output.
I'm using Umbraco 7.1, rendering engine WebForms.
I've tried 2 approaches both with the same result.
First approach:
I've created a new Image Cropper datatype called "Picture Cropper" with a crop called "cropPicture". Next I've created a property on a DocumentType called "picture" of type "Picture Cropper".
Using razor I retrieve the image data as a string: @node.picture. I've also tried several options like @node.GetCropUrl("picture", "cropPicture"); I've also tried it without the first parameter and I've tried it with propertyAlias: picture, cropAlias: cropPicture.
Second approach using MediaPicker:
I've added a crop called "cropPicture" to the default Image Cropper. Next I've created a new Media Type called "Media Image Cropper" with a property called "picture" of type "Image Cropper". Next I add a MediaPicker property called "picture" on a DocumentType. In Razor I type: dynamic media = Media.MediaById(node.picture) which gives me a long string with focalpoint and crops. I've also tried @media.crops.Find("picture", "cropPicture") but this does not work either.
What are the steps one should take when one has the image data as a string?
Any help appreciated.
Regards,
Erik.
Hi Erik,
It sounds like you have it setup correctly, however I think your issue is that you are using a Razor Macro with DynamicNode which are now legacy, instead you should be using Partial View Macros, then the GetCropUrl method would be working.
Let me know if this makes sense?
Jeavon
Tnx,
This solved my problem!
Regards,
Erik.
is working on a reply...