Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
As always i'm having trouble with the image cropper...
I'm listsing sub pages of the current page and want a fixed crop from each page. Simple i guess...
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage<ContentModels.Gallerier> @using ContentModels = Umbraco.Web.PublishedContentModels; @{ Layout = "Master.cshtml"; var selection = CurrentPage.Children().Where("Visible"); } <div> @foreach(var item in selection){ var mediaGet = item.GetPropertyValue<IPublishedContent>("teaserbillede"); <img src="@mediaGet.GetCropUrl(width: 300, height: 200)" /> } </div>
Error: 'Umbraco.Web.PublishedContentModels.Image' does not contain a definition for 'GetCropUrl'
Fixed it
@foreach(var item in selection){ var mediaGet = item.GetPropertyValue("teaserbillede"); <div> @if (mediaGet != null) { int mediaID = @mediaGet.Id; var mediaItem = Umbraco.TypedMedia(@mediaID); <img src="@Url.GetCropUrl(mediaItem, width: 800, height: 300)" /> } </div> }
Hi Claus,
Thanks a million times! With your code I could solve my cropper issue :)
Best, Simeon
You're welcome :)
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
7.6.3 image cropper ... again
As always i'm having trouble with the image cropper...
I'm listsing sub pages of the current page and want a fixed crop from each page. Simple i guess...
Error: 'Umbraco.Web.PublishedContentModels.Image' does not contain a definition for 'GetCropUrl'
Fixed it
Hi Claus,
Thanks a million times! With your code I could solve my cropper issue :)
Best, Simeon
You're welcome :)
is working on a reply...