Getting started with an Orchard Core Theme¶
In this article, we are going to create an Orchard Core Theme by adding it to an existing Orchard Core CMS application created previously.
Create an Orchard Core Theme¶
- Install the Code Generation Templates
- Create a folder alongside (not within) the application folder created before, with the name of your theme (Ex:
MyTheme.OrchardCore) and open it. We are going to create a new project in this folder.
- Execute the command
dotnet new octheme
- In Visual Studio, add the newly created theme project to the solution, then add a reference to the project from the main Orchard Core CMS Web application.
- Set the main Orchard Core CMS Web application as the startup project.
A thumbnail can also be created by adding a
Theme.png in the
The properties of the theme can be changed in the Manifest.cs file:
using OrchardCore.DisplayManagement.Manifest; [assembly: Theme( Name = "MyTheme", Author = "My name", Website = "https://mywebsite.net", Version = "0.0.1", Description = "My Orchard Core Theme description." )]
The theme should be available in the
Active themes admin page, and can be set as the default theme.