Skip to content
Discussion options

You must be logged in to vote

Hi

I have managed to make it work. Last time, intellisense wasn't working correctly on my computer, so I had to reinstall VS2022 later in the day.

This time, it suggested @using OrchardCore so my page now looks like this

@page "/blogpost/{id}"
@using OrchardCore
@Inject OrchardCore.IOrchardHelper Orchard

@{
var blogPost = await Orchard.GetContentItemByIdAsync(Id);
}

This is the blog post: @blogPost.DisplayText

@functions
{
[FromRoute]
public string Id { get; set; }
}

So I think the original question I had is now answered.

Thanks again for your help.

Hopefully now I can learn how to create Razor templates and make some websites with them!

Regards

Phil

Replies: 12 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by philipcj
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@hishamco
Comment options

Comment options

You must be logged in to vote
1 reply
@hishamco
Comment options

Comment options

You must be logged in to vote
1 reply
@hishamco
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants
Converted from issue

This discussion was converted from issue #17987 on June 07, 2025 14:40.