I would suggest taking a look at what the output of the editor is, and then change what you need.
Another way is to read the code that the editor is using, and then figure out the methods used. It may be a bit difficult to get working, since it is based on something that is not static (doc type setup).
Should the Udis reference something, or are the just some kind of early placeholders, until we find a way to store the element data somewhere else in the database, and not in json on the specific property in [umbracoPropertyData]
Adding Block List Editor elemtens via on contentService created IContent
I'm trying to add new content to a nested BlockListEditor via the ContentService in an UmbracoApiController.
I'm not sure how to accomplish this.
I have a dataset with multiple texts and youtube video ids, i need to insert into the BlockListEditor as elements.
Now i need to add elements to a BlockListEditor the same way. How do i create the elements and/or the json for the BlockListEditor ?
Hi Martin,
I would suggest taking a look at what the output of the editor is, and then change what you need.
Another way is to read the code that the editor is using, and then figure out the methods used. It may be a bit difficult to get working, since it is based on something that is not static (doc type setup).
hth :)
Hi Søren
I've been doing that :)
The BlockListEditor is based on json, stored in [umbracoPropertyData] i the database.
The problem for me right now, is how to create the UDI's stored on each element in the json, and what are the being used for?
Hi Martin,
Based on that json you posted:
layout -> umbraco.blocklist -> a list of blocks, that points to content
contentData -> list of content
The list of content has an udi, that is made from a Guid like this:
I would guess that the other properties in the content, is mapped to properties defined by the content type, identified by the contentTypeKey.
hth :)
Thx, i'm on the right track now i think :)
Still having a hard time figuring this out - mainly the
umb://element/
UDI.I cant figure out what this is used for, is this just a temporary UDI, for when this get resolved New RFC: How to store Element Data, being discussed here Initial proposal for a way to store Element Data.
Should the Udis reference something, or are the just some kind of early placeholders, until we find a way to store the element data somewhere else in the database, and not in json on the specific property in [umbracoPropertyData]
yes, it's just an internal ref :)
It may be stored in a different way later on, but for now it looks in the contentData array (first).
Thx - that was my last worry :)
Hi, did you ever get this working?
I have tried the same thing but get an this error:
Error parsing Infinity value. Path '', line 1, position 2. Exception Details Newtonsoft.Json.JsonReaderException: Error parsing Infinity value. Path '', line1, position 2.
I have also tried copying the value from umbracoPropertyData for a version where I manually created the BlockList items but that gives the same error.
Thanks for any help you can be.
is working on a reply...