Contents with the Content field Tag Node
-
User Picker Field, the new user ID - This week in Orchard (06/12/2020)
Admin UI, Permissions, Localization, This week in Orchard, Content field, Role, PermissionThis time we will do a little deep dive and check out some important changes in the code base of Orchard Core. But don't be scared, we promise you will like these changes, especially the demo about the new User Picker Field!
-
Why is my content part not recognized in Orchard Core? - Orchard Core Nuggets
Orchard Core Nuggets, Content field, Content partYou 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 theConfigureServices
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 theAddContentPart
extension method, where you just only need to provide your content part:services.AddContentPart<MyAwesomePart>();
. TheAddContentPart
and theAddContentField
(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 thePersonPart
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. -
Advanced content management and starting with theme development - Dojo Course
Tutorial, Dojo Course, Content field, Theme, ShapeUPDATE (2017-11-22): Dojo Course 2 is released with new, updated videos!
-
Forum favourites: model editors with shapes, accessing a shape's generated html and accessing content fields programmatically
Community resource, Development, Forum favourites, Content field, ShapeForum topics from the Orchard discussion board that we found interesting:
- "Passing my own data types to a view": using form field html helpers with dynamic models and in alternates defined with the shape attribute
- "Dynamically built html with Clay": capturing the generated html coming from a shape
- "How to access fields of a content item again?": ways of accessing a content field's value by using dynamic or statically typed extension methods