Contentment
Contentment is a community package that provides custom data sources and property editors. UmBootstrap uses it for features that need dynamic data pickers.
Version
Section titled “Version”UmBootstrap uses Contentment v6.1.1.
How It’s Used
Section titled “How It’s Used”Data List with Custom Data Source
Section titled “Data List with Custom Data Source”The Navigation - In Page feature uses a Contentment Data List with a custom FeatureBlockDataSource (C# class implementing IContentmentDataSource). This data source scans all block grid properties on the current page and returns feature blocks as selectable items in an Item Picker.
Request Body Buffering
Section titled “Request Body Buffering”Contentment’s API sends the current document’s GUID in the POST request body. To read this, Program.cs includes EnableBuffering() middleware for Contentment API paths:
app.Use(async (context, next) =>{ if (context.Request.Path.StartsWithSegments("/umbraco/management/api/v1/contentment")) { context.Request.EnableBuffering(); } await next();});Data Source Registration
Section titled “Data Source Registration”Custom data sources are registered by their fully qualified type name:
Namespace.ClassName, AssemblyNameFor example: Umbootstrap.Web.DataSources.FeatureBlockDataSource, Umbootstrap.Web
Known Limitations
Section titled “Known Limitations”IContentmentContentContext.GetCurrentContentId()returns0in Umbraco 17 (the API sends a GUID, not an integer ID). The workaround is to read the document GUID from the POST request body.- The Item Picker does not currently render group headings, though
DataListItem.Groupis populated ready for when it does.