From an UmbracoAuthorizedApiController I would like to use an Umbraco service Api (ContentService) to manipulate property data contained in BlockList components. So far, while non-BlockList properties are available using the ContentService, all Blocklist properties are not. This snippet will write all non-BlockList properties but omits the BlockList ones
var contentType = _contentTypeService.Get("blogPost");
var contentOfType = _contentService.GetPagedOfType(contentType.Id, 0, int.MaxValue, out long totalArchive, null);
foreach (var content in contentOfType)
{
foreach(var property in content.Properties)
Debug.WriteLine($"Content Property Alias: {property.Alias}");
...
I’ve found plenty of docs covering how to create a BlockList and already use custom BlockList views with
Umbraco.Cms.Web.Common.Views.UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockListItem>
but I’m stuck on this one.
Feel like I’m missing something obvious…tips or pointers much appreciated!
This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/112682-work-with-blocklist-properties-using-the-umbraco-content-service-v12