Orchard Core Templates uses dotnet new template configurations for creating new websites, themes and modules from the command shell.
dotnetnewinstallOrchardCore.ProjectTemplates
The following templates will be installed.
Template Name
Short Name
Orchard Core CMS Module
ocmodulecms
Orchard Core CMS Web App
occms
Orchard Core MVC Module
ocmodulemvc
Orchard Core MVC Web App
ocmvc
Orchard Core Theme
octheme
To get started, first create an empty .NET solution.
dotnetnewsln--nameOCBC.HeadlessCMS
After that, create a new Orchard Core project with the CMS Web App template.
dotnetnewoccms-nOCBC.HeadlessCMS
This should create a new .NET project with the NuGet package OrchardCore.Application.Cms.Targets.
After that, please remember to add the project to the solution with dotnet sln add.
dotnetslnaddOCBC.HeadlessCMS
The Cms.Targets package contains the things we need to setup an Orchard Core installation. It contains TheAdmin theme, and two recipes to base our installation on, but no front end themes. It also contains setup recipes for the Themes and multiple CMS Starter Themes.
Then we can update the Program.cs with the following code.
varbuilder=WebApplication.CreateBuilder(args);builder.Services.AddOrchardCms() // Orchard Specific Pipeline.ConfigureServices(services=>{}).Configure((app,routes,services)=>{});varapp=builder.Build();if(!app.Environment.IsDevelopment()){app.UseExceptionHandler("/Error");app.UseHsts();}app.UseHttpsRedirection();app.UseStaticFiles();app.UseOrchardCore();app.Run();
Now if we perform dotnet run, we should be able to see the Setup page of Orchard Core as shown below.