How do I get the URL of a certain post and an uploaded image from within the Content-BlogPost.cshtml
alternate as a string?
[EDIT]
Link:
I can access the ContentItem of my blog post via Model.ContentItem.BlogPostPart.ContentItem
. I can access the title and published date, via Model.ContentItem.BlogPostPart.Title
and Model.ContentItem.BlogPostPart.PublishedUtc
respectively. I can't find any URL field there though.
I know I can generate a link tag using @Html.ItemDisplayLink(Title, ContentItem)
but I want to get the URL string as it is.
I've found the solution is as simple as using
@Url.ItemDisplayUrl(contentItem)
:I will now mark this as an answer and create a new question for the media image question.