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
Hi when using an inline cshtml macro if i spit the contents out to screen of say @item.photo it returns: umb://media/9086fdeed168494f82e8fc195999c7e2
Just wondering how to convert that to an image url?
Hi Tom
You see UDI this is new ids in Umbraco, it means that Umbraco Property Value converters are enabled in your project.
Can you show all your code?
THanks,
Alex
Hi Alex, I ended up having to do something like this to display the photo.. is this the preferred way or is there something easier?
@{ int photoId = 0; Udi udi = null; if(!string.IsNullOrEmpty(hrStaffItem.photo) && Udi.TryParse(hrStaffItem.photo.ToString(), out udi)) { var mediaItem = udi.ToPublishedContent(); <figure> <img src="@GlobalHelpers.PhotoResize(@mediaItem.Url, 160, 198)" alt="@hrStaffItem.Name" /> </figure> } }
Can you show all the code?
Thanks,
<umbraco:Macro runat="server" language="cshtml">
@{ int staffCount = 0; foreach (var hrStaffItem in Model.Children) {
</div>
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Umbraco 7 Webforms Display Image in Inline Macro
Hi when using an inline cshtml macro if i spit the contents out to screen of say @item.photo it returns: umb://media/9086fdeed168494f82e8fc195999c7e2
Just wondering how to convert that to an image url?
Hi Tom
You see UDI this is new ids in Umbraco, it means that Umbraco Property Value converters are enabled in your project.
Can you show all your code?
THanks,
Alex
Hi Alex, I ended up having to do something like this to display the photo.. is this the preferred way or is there something easier?
Hi Tom
Can you show all the code?
Thanks,
Alex
@{ int staffCount = 0; foreach (var hrStaffItem in Model.Children) {
} }
@hrStaffItem.Name
}
is working on a reply...