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
Hello,
I have a websevice using Umbraco's Web API to lazy load some child nodes content.
I'm struggling to figure out how to get the CropUrl from the JSON that is saved for the property.
This is my code.
var news = help.TypedContent(newsParent).Children().Where("Visible").Select(obj => new NewsItem() { Name = obj.Name, Id = obj.Id, PostTitle = obj.GetPropertyValue<string>("postTitle"), PostHeroImage = obj.GetCropUrl("postHeroTitle", "Square"), URL = obj.Url, CreateDate = obj.CreateDate, ParentName = obj.Parent.Name });
The crop's property alias is postHeroTitle.
Any ideas?
I've solved my problem.
Using the standard obj.GetCropUrl("propertyAlias" , "cropAlias") worked. Updated code below.
var news = help.TypedContent(newsParent).Children().Where("Visible").Select(obj => new NewsItem() { Name = obj.Name, Id = obj.Id, PostTitle = obj.GetPropertyValue<string>("postTitle"), PostHeroImage = obj.GetCropUrl("postHeroImage", "16:9"), URL = obj.Url, CreateDate = obj.CreateDate, ParentName = obj.Parent.Name });
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
GetCropUrl from Umbraco API
Hello,
I have a websevice using Umbraco's Web API to lazy load some child nodes content.
I'm struggling to figure out how to get the CropUrl from the JSON that is saved for the property.
This is my code.
The crop's property alias is postHeroTitle.
Any ideas?
I've solved my problem.
Using the standard obj.GetCropUrl("propertyAlias" , "cropAlias") worked. Updated code below.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.