I´m trying to use the Content API to create my data, that as a Vorto object inside, but, the main and non-vorto fields are created, and the vorto fields aren't.
I'm using this code. Is there something that should be changed?
(I always got Success. Non-vorto fields not represented here, because they are working fine).
TIA,
/Luis
VortoValue vortoValues = new VortoValue();
vortoValues.Values = new Dictionary<string, object>();
vortoValues.Values.Add("en", new MyPressClass()
{
pageTitle = "This is the page title",
text = "<p>This is the content text</p>"
});
vortoValues.Values.Add("dk", new MyPressClass()
{
pageTitle = "Dette er siden titel",
text = "<p>Dette er indholdet tekst</p>"
});
var newContent = Services.ContentService.CreateContent("New document", 1234, "myDataType");
newContent.SetValue("vortoContent", JsonConvert.SerializeObject(vortoValues));
var result = Services.ContentService.SaveAndPublishWithStatus(newContent);
if (result.Success)
iTotal++;
else
iErrors++;
Unless there's some issue when creating trough the Content API, it should work also with only 2 letters in the culture, because it wrwhen saving data from the backoffice and also it is possible to chose cultures with only two letters in the languages settings.
Creating Vorto content with Content API
Hello.
I´m trying to use the Content API to create my data, that as a Vorto object inside, but, the main and non-vorto fields are created, and the vorto fields aren't.
I'm using this code. Is there something that should be changed? (I always got Success. Non-vorto fields not represented here, because they are working fine).
TIA, /Luis
Hi
I'm not sure that this is the case, but are you sure that culture name should be 2 letters?
/Alex
Hi Alex.
Unless there's some issue when creating trough the Content API, it should work also with only 2 letters in the culture, because it wrwhen saving data from the backoffice and also it is possible to chose cultures with only two letters in the languages settings.
/Luis
is working on a reply...