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?
Try to reference the
OrchardCore.Application.Cms.Core.TargetsNuGet package instead of the
OrchardCore.Application.Cms.Targetsin your ASP.NET Core web application, that will only add the TheAdmin theme to your solution.
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!
You have implemented your
MyAwesomePartbut 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
ConfigureServicesmethod add the following line:
But if you are using the RC1 version of Orchard Core or newer you can use the
AddContentPartextension method, where you just only need to provide your content part:
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
PersonPartin the service container. We also mentioned the new way of registering ContentParts and ContentFields in this post of our This week in Orchard series.