OrchardCMS / OrchardCore

Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
https://orchardcore.net
BSD 3-Clause "New" or "Revised" License
7.42k stars 2.39k forks source link

Better razor pages support #1547

Closed alberthajdu closed 4 months ago

alberthajdu commented 6 years ago

Authorize

services.Configure<RazorPagesOptions>(options =>
            {
                options.Conventions.AddModularPageRoute("/ModuleId/Pages/Test", "test");
// The next line doesn't work.
                options.Conventions.AuthorizePage("/test");
            });

Recipes

HomeRoute should support razor pages.

agriffard commented 6 years ago

Is HomeRoute support razor pages available?

agriffard commented 4 years ago

Isn't it possible to set a Razor page as the HomeRoute? With a Recipe Step?

sebastienros commented 4 years ago

@jtkech how can we set a razor page with HomeRoute?

@alberthajdu what is options.Conventions.AuthorizePage("/test"); supposed to do?

jtkech commented 4 years ago

Autoroute map routes to content items and just provides a way to define an home route through settings. Then HomeRoute is a concrete implementation that uses these settings to map the home route to a content item.

So we would need another feature to define an home page differently, or update Autoroute to have additional options, and then another feature to map these settings to a razor page by updating the route values e.g with the page specific value, the area value and so on, or update HomeRoute to use these additional options.

That said we can already define a razor page as an home page by using @page "/"

Or through the following mvc helper as commented in the demo module

            // This declaration would define an home page
            //options.Conventions.AddAreaPageRoute("OrchardCore.Demo", "/Hello", "");
github-actions[bot] commented 5 months ago

It seems that this issue didn't really move for quite a while. Is this something you'd like to revisit any time soon or should we close? Please reply.

github-actions[bot] commented 4 months ago

Closing this issue because it has been stale for very long. If you think this is still relevant, feel free to reopen it.