Our blog contains the activity stream of Orchard Dojo: general news, new resources or tutorials are announced here.

Centralize the Indexing process, Remove Media files for a removed tenant when using Azure Blob Storage - This week in Orchard (20/06/2025)

This time, you can see a demo about centralizing the Indexing process and having a unified UI for managing Indexes and the Search Settings! But first, let's look at our other topics, like removing Media files for a removed tenant when using Azure Blob Storage, and adding RouteEndpoint cache. Don't forget that you can still fill out our Orchard Core Admin UI experience renewal survey to help shape the future of Orchard Core!

Latest tutorials

Featured tags

IIS
API
SMS
SEO
MCP
All tags >

How to localize content items? - Orchard Core Nuggets

So you want to create an Orchard Core website that presents its content in multiple languages. There are many parts of this, but what about content items? How do you make them ready for localization? We'll assume that you have your site already set up. We'll use the Page content type found in e.g. the Agency setup recipe as an example. First, make sure that you've set up available site cultures on the Orchard dashboard. This is under Configuration, Settings, Cultures (or the /Admin/Settings/localization URL). Set up LocalizationPart for content types to be localized as mentioned in the docs. Now comes the hard part: You need content items' URLs to be generated with the culture in it, so something like "en-US/demo". This is so you can have two versions of a content item, in different languages but with the same slug ("demo"). So, edit the settings of the Autoroute part from under the content type's editor under the Content menu on the admin, Content Definition, Content Types. For the Page type it's here: /Admin/ContentTypes/Page/ContentParts/AutoroutePart/Edit. There you need to change the default Autoroute pattern to include the culture's ID. This you can do by accessing the culture set in LocalizationPart, so the whole pattern will be something like this: {{ Model.ContentItem.Content.LocalizationPart.Culture }}/{{ Model.ContentItem | display_text | slugify }}. That's pretty much it. Now when you create a new Page you'll be able to tell Orchard which culture it belongs to and the URL will automatically reflect that. This is of course not the complete localization story. You'll also need to display the culture options to the user which you can do with the ContentCulturePicker shape as explained here. Other UI labels coming from code need to be localized too with PO files, as you can read about in the docs too. Have fun with your multi-language sites! We also have a follow-up post on how to add a culture URL segment for non-content pages. 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!

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

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!

How to use the same version of Orchard Core NuGet packages in every project across my solution? - Orchard Core Nuggets

You have your own ASP.NET Core project that using Orchard Core NuGet packages, but every time when you update them you have to do it one-by-one across the whole solution? Wouldn't it be easier to just update the package versions in one place? Then you may need to have a Directory.Build.targets file to define the versions! MSBuild projects that use the standard build process (importing Microsoft.Common.props and Microsoft.Common.targets) have several extensibility hooks that you can use to customize your build process. Directory.Build.targets is imported from Microsoft.Common.targets after importing .targets files from NuGet packages. So, it can override properties and targets defined in most of the build logic, but sometimes you may need to customize the project file after the final import. Without going into too much detail, Directory.Build.targets can be used to provide customizations to project files located under a certain directory, this means that if you create such a file at the root of your solution, it would normally be able to customize all the .csproj files in your solution as they would exist in the child directories. Let's see a small example! Imagine you have an ASP.NET Core web application with a MyAwesomeWebApp.Web.csproj file. If you referenced Orchard Core in this project, your file contains a similar section: <ItemGroup> <PackageReference Include="OrchardCore.Logging.NLog" Version="1.0.0-rc1-10106" /> <PackageReference Include="OrchardCore.Application.Cms.Targets" Version="1.0.0-rc1-10106" /></ItemGroup> I assume you also have some custom modules and themes in your solution. The .csproj file of your module (MyAwesomeModule.csproj) could contain a section like: <ItemGroup> <PackageReference Include="OrchardCore.ResourceManagement" Version="1.0.0-rc1-10106" /> <PackageReference Include="OrchardCore.DisplayManagement" Version="1.0.0-rc1-10106" /> <PackageReference Include="OrchardCore.Module.Targets" Version="1.0.0-rc1-10106" /></ItemGroup> where the OrchardCore.Module.Targets is mandatory if it is a module. Imagine that your theme (MyAwesomeTheme.csproj of course) has the following: <ItemGroup> <PackageReference Include="OrchardCore.Theme.Targets" Version="1.0.0-rc1-10106" /> <PackageReference Include="OrchardCore.DisplayManagement" Version="1.0.0-rc1-10106" /> <PackageReference Include="OrchardCore.ResourceManagement" Version="1.0.0-rc1-10106" /></ItemGroup> You can see that we referenced OrchardCore.DisplayManagement and OrchardCore.ResourceManagement packages multiple times. If there will be a new release of Orchard Core we have to make sure that we use the same versions of every package across the whole solution. And if we have several projects we have to change the version numbers in every project one by one. To solve this issue add a Directory.Build.targets file at the root of your solution. We set the version in this file and specify how each <PackageReference /> should be updated by MSBuild. Note that here we have to use Update instead of Include. <?xml version="1.0" encoding="utf-8"?><Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup> <!-- Implicit Package References --> <PackageReference Update="OrchardCore.Application.Cms.Targets" Version="1.0.0-rc1-10106" /> <PackageReference Update="OrchardCore.DisplayManagement" Version="1.0.0-rc1-10106" /> <PackageReference Update="OrchardCore.Logging.NLog" Version="1.0.0-rc1-10106" /> <PackageReference Update="OrchardCore.Module.Targets" Version="1.0.0-rc1-10106" /> <PackageReference Update="OrchardCore.ResourceManagement" Version="1.0.0-rc1-10106" /> <PackageReference Update="OrchardCore.Theme.Targets" Version="1.0.0-rc1-10106" /> </ItemGroup></Project> Now let's rewrite the content of all the .csproj files and see the result of the MyAwesomeTheme.csproj for an example! The Include attribute specifies the package ID and the Version attribute specifies the version of the package to restore. But as you can see here the only change we did is to remove the Version attribute. <ItemGroup> <PackageReference Include="OrchardCore.Theme.Targets" /> <PackageReference Include="OrchardCore.DisplayManagement" /> <PackageReference Include="OrchardCore.ResourceManagement" /></ItemGroup> Now nothing will stop you from easily update the Orchard Core NuGet packages of your ASP.NET Core website! 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!

Why is my content part not recognized in Orchard Core? - Orchard Core Nuggets

You have implemented your MyAwesomePart but you cannot attach it to your content type using the dashboard because it's not showing in the Content Parts list (Content -> Content Definition -> Content Parts)?The most possible reason for this that you haven't registered your implementation in the service container. To register your class in the service container head to the Startup.cs file of your module and in the ConfigureServices method add the following line: services.AddSingleton<ContentPart, MyAwesomePart>();But if you are using the RC1 version of Orchard Core or newer you can use the AddContentPart extension method, where you just only need to provide your content part: services.AddContentPart<MyAwesomePart>();. The AddContentPart and the AddContentField (that you can use to register your fields) can be found in the OrchardCore.ContentManagement namespace.Another recommendation is to use the Part suffix when naming your class or cs file that contains your custom part. Don't forget to put it in a Models folder to follow the recommendation of the MVC (model-view-controller) software design pattern.For more information about registering your Part check out the Startup.cs file of our Orchard Core Training Demo module, where we registered the PersonPart in the service container. We also mentioned the new way of registering ContentParts and ContentFields in this post of our This week in Orchard series. 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!

Advanced Orchard: accessing other tenants' services

Many using Orchard's multi-tenancy feature sooner or later want to share data between tenants or generally, execute some operations on other tenants from one tenant. This is possible! Let's see how. First some core Orchard fundamentals: Orchard creates so called shells for tenants. These shells describe that sub-application what a tenant is, among others the shell also has its own Autofac IoC container. This container deals with all the dependencies that are injected or otherwise requested. The interesting thing is that you can access the shell - the shell context - of all running tenants and through it also their IoC container. Now if you have the container you can make dependency resolution calls on it - what means that you can resolve services from that shell, i.e. that tenant. public class TenantAccessDemo { // ShellSettingsManager lets you access the shell settings of all the tenants. private readonly IShellSettingsManager _shellSettingsManager; // OrchardHost is the very core Orchard service running the environment. private readonly IOrchardHost _orchardHost; public TenantAccessDemo(IShellSettingsManager shellSettingsManager, IOrchardHost orchardHost) { _shellSettingsManager = shellSettingsManager; _orchardHost = orchardHost; } public void UseServicesFromTenant() { // Fetching the shell settings for a tenant. This is more efficient if you have many tenants with the Lombiq Hosting Suite, // see below. var tenantShellSettings = _shellSettingsManager.LoadSettings().Where(settings => settings.Name == "TenantName").Single(); var shellContext = _orchardHost.GetShellContext(tenantShellSettings); // Creating a new work context to run our code. Resolve() needs using Autofac; using (var wc = shellContext.LifetimeScope.Resolve<IWorkContextAccessor>().CreateWorkContextScope()) { // You can resolve services from the tenant that you would normally inject through the constructor. var tenantSiteName = wc.Resolve<ISiteService>().GetSiteSettings().SiteName; // ... } } } If you're operating a multi-tenant environment you may also want to look at the Lombiq Hosting Suite: among others it has a Maintenance feature that you can use to run code in the context of tenants in a safe and scheduled way. Also it has an extended ShellSettingsManager that stores shell settings in the database: this means you can have any number of tenants, you can even fetch their settings by name or you can page when listing them and you don't have to take care about all the Settings.txt files in App_Data.

Beginning with Orchard: what to start with?

So you'd like to begin exploring Orchard because somebody sold Orchard to you. This is great! Now probably your next question is: how should I start, how can I try Orchard in action? Glad you asked. There are several simple and less simple ways, all free, so let's see. We'll start with the easy ways and build up the tension so you end up with the most complicated one if you want to become an Orchard developer. Going on a test drive with "Try Orchard!" No registration, no setup, nothing required, you can just go to Try Orchard!, open one of the continuously re-installed demo sites and play with it. This is the simplest way of taking the first steps with Orchard. Be aware though that Try Orchard! is really just for testing: since the demo sites are wiped out hourly you don't try to publish your blog there! Creating an Orchard site on DotNest DotNest is the Orchard SaaS provider: this means that you can simply register and create Orchard websites that run in the cloud without any hassle. Your website will just work: you don't have to deploy and later upgrade it, you can just use it. With DotNest you can try out Orchard very simply, very quickly and since your website is already hosted for you you can also show it to everybody. Apart from getting used to the user interface and features of Orchard you can also get into the basics of Orchard theme development with it and style and customize your Orchard website in a lot of ways. Convenience does come with disadvantages: due to the architecture of DotNest you can't install custom modules, so you have to use what is already available (that however should be enough for a big part of websites). Creating an Orchard website on Azure Web Sites Still not very complicated but a bit more advanced than using DotNest is going with Azure Websites. On MAWS after a free registration you can create websites from the Azure Gallery where you can select Orchard to deploy in one click too. Your Orchard site on MAWS will be completely under your control: you can install any module and theme you want too. However this also comes with responsibilities: you have to maintain your website yourself, upgrade and fix it as necessary. Installing Orchard locally via WebMatrix The first two options showed you the quickest ways of beginning to use Orchard that don't require you to install anything on your computer. Now we're getting into the realm of running Orchard on your local computer! WebMatrix is a simple development toolbox that you can also use to install and run Orchard on your box, as explained in the Orchard documentation. This gives you even more control but also more work to do: you can do what you want with your local Orchard instance, you can even start writing code for your custom Orchard theme or module and run those too. From WebMatrix it's also relatively easy to deploy your Orchard site to a public host. However with this option you have to maintain your site, fix any issues that third-party modules you install may cause and you have to keep Orchard up-to-date yourself. Running Orchard locally from the full source This is the real hardcore option, but you'll need to do this if you want to be a black-belt Orchard developer. You can download the full Orchard source either as a zip file from under the Releases section of the project site or you can even clone the repository via git from https://github.com/OrchardCMS/Orchard.git. You'll need Visual Studio to open, build and run the source: but since you're an aspiring developer this shouldn't be a big deal. By using the full source you can browse through Orchard's internals to get to know it better. If you need examples you'll have all the built-in modules at hand. Running Orchard locally and deploying it is the same as with any other web application. You can simply run Orchard by hitting (Ctrl +) F5 and it will spin up through IIS Express. If you want to get away from the simple SQL CE database option and want to use a proper database you'll have to install and configure SQL Server too. You can even use the full power of IIS and run Orchard as you would on a naked Windows Server. Getting Orchard running with IIS and SQL Server is something not trivial though. If you're working in a team or you just want to store your code in source control things get a bit even more complicated but there are established practices that you can use. Good luck with getting up and running with Orchard!

Client-side development and a little more of the Orchard API - Dojo Course

UPDATE (2017-11-22): Dojo Course 2 is released with new, updated videos! This week on Dojo Course we move on to some frontend-related development and see how to use static resources and other important features provided by MVC and Orchard. After that we return to the server-side to learn something new. How to add your static resources to your templates? Script/Style.Include/Require. Some userful helpers to customize your templates. Dynamically creating and displaying a shape. How to protect yourself against cross-site request forgery attacks? Posting forms and using the MVC model binder to check if the entered data in our editor is valid or not. Some debugging and bug hunting (restarting the system solved the mystery). And now, for something completely different: file management in Orchard using the IStorageProvider. Remember: if you have any questions don't hesitate to ask them by creating a new issue in the Orchard issue tracker with the "discussion" label. Make sure to prefix your thread's title with "Dojo Course - "! We keep an eye on these issues. Also follow us on Twitter to get notified about the latest Dojo Course news, including when a new tutorial is posted. Do you have some feedback about the course? Please send it in.

Diving into the Orchard API - Dojo Course

UPDATE (2017-11-22): Dojo Course 2 is released with new, updated videos! This week on Dojo Course we dive into the Orchard API, use some of the build-in services and extending the capabilities of our module to make it even better! Using LazyField<T> to load data lazily so they are only loaded when we really need them. Using Work<T> to load dependencies lazily so they are only resolved when we really need them. Applying the [Admin] attribute for admin-related Getting to know an other Orchard service: IAuthorizer. Creating our own permissions by implementing the IPermissionProvider. Using the ContentManager so we can finally work with content items! Generating ad-hoc shapes and matching them to an actual template. Implementing the IResourceManifestProvider interface for managing static resources. Remember: if you have any questions don't hesitate to ask them by creating a new issue in the Orchard issue tracker with the "discussion" label. Make sure to prefix your thread's title with "Dojo Course - "! We keep an eye on these issues. Also follow us on Twitter to get notified about the latest Dojo Course news, including when a new tutorial is posted. Do you have some feedback about the course? Please send it in. Haven't you enrolled yet? Why not do it some time in the near future like right now?

Content Part development continued - Dojo Course

UPDATE (2017-11-22): Dojo Course 2 is released with new, updated videos! This week on Dojo Course we are giving life to our content part by adding several Orchard-y code pieces to it, though the result is far from being Frankenstein-like. While doing that, we also discover some interesting and useful pieces of the Orchard API. Creating a migration for our Contents feature. Difference between ContentPartRecord and ContentPartVersionRecord: versioning content parts. Making your content part attachable to content types (on the Admin UI). Creating a content type using migrations and attaching parts to it. Creating a handler for our content part to do some plumbing (e.g. StorageFilter). Creating a driver for our content part to cover server-side part of the the user interface interaction. How displaying a shape works, what is DisplayType? Shape templates (also editors) and using Placement. Using InfosetPart to store a part's data in the content item's XML infoset document. This eliminates content part record lazy loading, providing a significant performance gain. The importance of driver shape factories. How to make your content part support importing and exporting? Remember: if you have any questions don't hesitate to ask them by creating a new issue in the Orchard issue tracker with the "discussion" label. Make sure to prefix your thread's title with "Dojo Course - "! We keep an eye on these issues. Also follow us on Twitter to get notified about the latest Dojo Course news, including when a new tutorial is posted. Do you have some feedback about the course? Please send it in. Haven't you enrolled yet? Why not do it some time in the near future like right now?

Data storage and content part development - Dojo Course

UPDATE (2017-11-22): Dojo Course 2 is released with new, updated videos! How to upgrade my table schema? How to store and retrieve records from my tables? How do I upgrade from using a plain set of records to using a content part? This week on Dojo Course we are moving on to uncover the mysteries of content parts. Making modifications to your Migrations classes: how to use the update methods. Quick recap on Dependency Injection and creating a service class to handle our records. Benedek has problems with typing when he knows he's being watched (actually, Zoltán as well) :). Difference between requiring a single and list of dependencies. How to (and how not to) use IRepository<T> to store and retreive records. Based on what we learned about records, we are starting to develop our first content part. Dividing your module into features (subset of functionalities) and declaring dependencies between them. Assigning pieces of code to specific features using the OrchardFeature attribute. Remember: if you have any questions don't hesitate to ask them by creating a new issue in the Orchard issue tracker with the "discussion" label. Make sure to prefix your thread's title with "Dojo Course - "! We keep an eye on these issues. Also follow us on Twitter to get notified about the latest Dojo Course news, including when a new tutorial is posted. Do you have some feedback about the course? Please send it in. Haven't you enrolled yet? Why not do it some time in the near future like right now?