Skip to content

Custom theme and Content Item (Content Type): how to manage Razor view and model #15298

Answered by MarGraz
MarGraz asked this question in Q&A
Discussion options

You must be logged in to vote

The issue with the controller not being hit was due to a missing mapping in the Startup.cs file of my theme project. The automatic Orchard template doesn't generate a Startup file by default, so I added one myself. Inspired by the OrchardCore.Demo module, which you can see here, I included the following route mapping, and it resolved the issue:

public class Startup : StartupBase
{
    public override void Configure(IApplicationBuilder builder, IEndpointRouteBuilder routes, IServiceProvider serviceProvider)
    {
        routes.MapAreaControllerRoute(
            name: "MySite.Home.Index", // Choose a name for this route
            areaName: "MySite.OrchardCore", // Insert your theme proj…

Replies: 3 comments 6 replies

Comment options

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

Comment options

You must be logged in to vote
5 replies
@MarGraz
Comment options

@hishamco
Comment options

@MarGraz
Comment options

@MarGraz
Comment options

@hishamco
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by MarGraz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants