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.25k stars 2.34k forks source link

OC Decoupled application #13503

Open agriffard opened 1 year ago

agriffard commented 1 year ago

Suggestion: Create an example of an application using OC with a Decoupled approach and make it a template.

This approach could be a good way for a beginner to create a site with dynamic and extendable contents edited from the admin.

Steps: Start with an empty Razor Pages application. Setup application as explained here: https://docs.orchardcore.net/en/latest/docs/guides/decoupled-cms/ Define a Page content with Alias, Title, HtmlBody. Create a Razor page with @page "/{alias}". Create a query to retrieve all pages and used it in a Razor page to list them with links.

Retrieve navigation from the default Menu? Retrieve Widgets? (Ex: Footer).

Use TheTheme? (it is not clear for me which one is used between the _Layout.cshtml of the application and the Layout from the OC theme). The contents also exist with their default content/contentitem/{uuid} urls which can be weird.

Export and create its own recipe.

Additionnal features: Enable Seo, add part, retrieve content and use data in the Head. Generate sitemaps based on url.

This could be done in another repository.

Anyone has already used OC this way? Any feedback, remarks would be appreciated.

hishamco commented 1 year ago

It could be in OC.Samples repo, also we could create the following:

Creating a simple functional app with 3 different approaches might be helpful for a startup

agriffard commented 1 year ago

See also #3553

hishamco commented 1 year ago

I already saw it, it would be nice if we had a sample for each, @dodyg do you have examples for OC Decoupled and CMS?

dodyg commented 1 year ago

@hishamco nope but I will be happy to work on both.

hishamco commented 1 year ago

@dodyg can we chat on gitter.im - which moved into Element app -

hishamco commented 1 year ago

I just started a quick design for TheTeamTheme which I will use to build the simple OC application for each approach: Full CMS, Decoupled & Headless

Web capture_8-4-2023_63325_

We need to write down a feature list for each approach, if anyone - other than @dodyg - is interested, please write your comment or you can contribute to the sample

sebastienros commented 1 year ago

My suggestion would be to make all these steps a full tutorial to explain how and why things are done this way. And obviously a sample site showing the end result.

hishamco commented 1 year ago

Sure a tutorial with all the steps will be helpful too. @dodyg are you still interested to work with me on this one?

dodyg commented 1 year ago

I can work with you after this week. My week this week after Eid vacation is packed.

hishamco commented 1 year ago

I can start a repo, but we need to chat via Gitter (Element) if it's possible

agriffard commented 1 year ago

What about a repo under the OrchardCMS organization? Something like OrchardCore.Apps.

Tutorials should be added to the docs and the solution could contain .NET templates with recipe.

I might also include an example made with Blazor, like https://github.com/agriffard/Zord

agriffard commented 1 year ago

We could also may be move the OrchardCore.ProjectTemplates project out of the solution in its own repository and start building 1.6.x versions of the nuget packages that will include new added templates.

hishamco commented 1 year ago

What about a repo under the OrchardCMS organization? Something like OrchardCore.Apps.

I never mind, but usually, I work without restrictions under OCC :) my aim is to add 3 apps with both razor & liquid.

I might also include an example made with Blazor, like https://github.com/agriffard/Zord

Cool, but I'm not sure if it's accepted to add such a thing under the Orchard organization, but for Orchard Core Contrib it's fine because nothing official from the original OC

Again I'm open to any feedback from the team or the community

hishamco commented 1 year ago

For OC we could use one of the available themes and rewrite it for full CMS, decoupled and headless

We could also may be move the OrchardCore.ProjectTemplates project out of the solution in its own repository and start building 1.6.x versions of the nuget packages that will include new added templates.

LGTM

sebastienros commented 1 year ago

We talked about it during the meeting. We said we should not move ProjectTemplates (nuget deployments, synching repositories). We can create sample apps in /OrchardCore.Samples. I personally prefer keeping these as samples in a repository instead of packaging them in NuGet dotnet templates (less deployment, synching, ...)

hishamco commented 1 year ago

I personally prefer keeping these as samples in a repository instead of packaging them in NuGet dotnet templates (less deployment, synching, ...)

That's why I suggested having them in OCC, then I will take care of packaging, deployment, and synching. Again I see a value in taking one of the samples that we have in OC and apply it for full CMS, decoupled and headless

FYI the one I'm talking about for OCC is TheTeamTheme