Catch-All routing with Blazor/OrchardCore De-Coupled CMS. #55181
Replies: 2 comments
-
Also, in Blazor, I can find no way to |
Beta Was this translation helpful? Give feedback.
-
Another problem I've found. Because you can't exclude segments, the next obvious thing would be to have multiple whitelisted segments, and then your slug. @page "/prefix-1/{*Slug}";
@page "/prefix-2/{*Slug}";
@page "/prefix-3/{*Slug}";
@inherits RoutedComponentBase;
@code {
[Parameter] public string? Slug { get; set; }
}
<ContentRouter Alias="@NavigationManager.ToBaseRelativePath(NavigationManager.Uri)" /> However, now, going from Is there any way to make this transient, so that it treats the parameters as changed, every single time? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm using Blazor8 with OrchardCore as a de-coupled CMS. I want
/admin*
to be routed by Orchard, and the rest to be routed by Blazor.Using this as a basic working example: https://github.com/ApacheTech/BlazOrchard
If I have a page with
@page "/{*Slug}";
, I want to give priority to/admin
to run through the MVC Area controller. It seems that Blazor strips all power away from MVC to route itself. I want Blazor to be the fallback.This is the page I would like to have work.
RenderContentItem.razor
Then all my components would be at
/Components/ContentTypes/{nameof(ContentType)}.razor
, and inherit fromCmsHostedComponentBase
that supplies access to the helper, and other injected tools, as standard.But, using this, calls to
/admin
result in the 404 component showing. MVC is ignored.Eventually, this site will be placed on a sub-domain, so I want the url structure to be
https://docs.domain.com/path/to/page
, without needing to add an awkward prefix,https://docs.domain.com/docs/path/to/page
.There must be a way to route the admin area separately. I thought that catch-all routes were supposed to have a very low priority, I didn't think it would stop legitimate calls to legitimate controllers.
Beta Was this translation helpful? Give feedback.
All reactions