Show specific crop of media item on template not using image cropper
I am using a property editor which lets me edit my image crops for the media item in the content section, without needing to go to the media section. On my template I want to show a specific crop from my media picker (single image), which was edited in the content section.
But so far I am only able to use the GetCropUrl method with the image cropper, which I don't have on my document type. I am using the included code in the documentation for showing a media item, but how do I use one of the predefined crops for my image to show in the template?
The reason I am not just using the image cropper instead, is that the user should not need to upload an image first in the content section.
@{
var typedMediaPickerSingle = Model.Content.GetPropertyValue<IPublishedContent>("featuredBanner");
if (typedMediaPickerSingle != null)
{
<p>@typedMediaPickerSingle.Url</p>
<img src="@typedMediaPickerSingle.Url" alt="@typedMediaPickerSingle.GetPropertyValue("alt")" />
}
}
Show specific crop of media item on template not using image cropper
I am using a property editor which lets me edit my image crops for the media item in the content section, without needing to go to the media section. On my template I want to show a specific crop from my media picker (single image), which was edited in the content section.
But so far I am only able to use the GetCropUrl method with the image cropper, which I don't have on my document type. I am using the included code in the documentation for showing a media item, but how do I use one of the predefined crops for my image to show in the template?
The reason I am not just using the image cropper instead, is that the user should not need to upload an image first in the content section.
Hi Thomas
This is great idea - a property editor which lets me edit my image crops for the media item in the content section
Can you share a source code?
Alex
Hi Thomas,
Did you find a solution? Share with our community, please
/Alex
Is the property editor you mentioned something you wrote, or is it a package already available somewhere?
is working on a reply...