How to use Orchard Core without the sample themes? - Orchard Core Nuggets

Gábor Domonkos's avatar
Orchard Core Nuggets, Theme, Scoped Liquid TemplateContext, Template Azure Blob with Liquid - This week in Orchard (10/01/2020)

Try to reference the OrchardCore.Application.Cms.Core.Targets NuGet package instead of the OrchardCore.Application.Cms.Targets in your ASP.NET Core web application, that will only add the TheAdmin theme to your solution.

Orchard Core has many built-in themes that can be useful, for instance, if you are searching for a way about how to override your templates using Liquid or Razor. By checking the code of these templates you can see the different custom Liquid helpers and Razor tag helpers in action. But if you would like to deploy your application it could be unnecessary to add these themes to your solution.

The Getting started with Orchard Core as a NuGet package page of the Orchard Core documentation mentioned to reference the OrchardCore.Application.Cms.Targets package. However, if you reference the OrchardCore.Application.Cms.Core.Targets you can modify your Startup.cs file the same way, but when you set up your application, you will only be able to use the Blank site recipe, that allows you to set up your site with additional pre-configured options, features, and settings out of the box.

Head to the bottom of the content of the OrchardCore.Application.Cms.Core.Targets.csproj file, where you can see that only the TheAdmin theme is referenced. And the only difference is that the OrchardCore.Application.Cms.Targets referencing the themes also among with the OrchardCore.Application.Cms.Core.Targets project.

This way you would get a smaller solution without the themes and have a smaller and faster-deployed app to your server with the complete CMS functionality!

Did you like this post? It's part of our Orchard Core Nuggets series where we answer common Orchard questions, be it about user-facing features or developer-level issues. Check out the other posts for more such bite-sized Orchard Core tips and let us know if you have another question!

No Comments

Add a Comment