I tested this scenario on an Alloy site. Added the contact block list as an IList to the article page and checked the content definitions using the API
[Display(
Name = "Kontakter",
GroupName = SystemTabNames.Content,
Order = 120)]
[AllowedTypes(AllowedTypes = new[] { typeof(ContactBlock) })]
public virtual IList<ContentReference> Contacts { get; set; }
The content definition (https://localhost:5000/api/episerver/v3.0/contenttypes/aeecadf2-3e89-4117-adeb-f8d43565d2f4)
{
"name": "Contacts",
"dataType": "PropertyContentReferenceList",
"branchSpecific": false,
"editSettings": {
"visibility": "default",
"displayName": "Kontakter",
"groupName": "Information",
"sortOrder": 120
}
},
So looking at the documentation and also decompiling the content definition binary the support for complex attributes seems not to be supported.
Hi,
I was playing around with the Content Definitions API and tried to create a list of custom block type or a content area restricted to a specific block type. I am unable to get it to work though. I provide some examples:
The code below creates a TextArea in the edit view so there's no way to create a new block...
Then I tried to create a content area using the code below. However, I can't find a way to restrict the allowed types (using the API).