It should work by default.
Do you have any Custom Property Model Converters (search for XHtmlPropertyModel in your code)? Or extending serialization of content?
Which version of API are you using?
We use the 2.17.0 and no Custom Property Converters.. no extension of serialization..
The blocks are just getting stripped off while all the other content goes through in the XHtmlString when making a call to the api..
Bit confusing why it gets stripped away :(, guess is how it works, but find no documentation around this
By default it should give you something like
"mainBody": {
"value": "<p>Your data</p>",
"propertyDataType": "PropertyXhtmlString"
}
well it does.. except the blocks are missing in the "Value"
[CultureSpecific]
[Display(
Name = "Hero introduction text",
Description = "Introduction text for the hero",
GroupName = TabNames.Hero, Order = 25)]
public virtual XhtmlString HeroIntroHeading { get; set; }
So nothing special.. but i guess something is happening while serializing the content..
no, no model converters.. i tried the example alloy test site and it works kind of out of the box.
so the issue is totally on our end :/. Thought i missed something obvious but the error is probably somewhere in our code somewhere..
Will keep this thread updated when i find what we have missed.. but i realise that its kind of hard to get help from someone without showing the code itself
Well is someone have some tip or pinpoints in right directions, they all are welcome :)!
Hello,
We have blocks within XHtmlString but they are removed when calling content delivery api..
I read that using a block having a corresponding view will work..
But we dont have any controllers and views, we have a headless solution.
What is the right way to implement support for blocks in XHtmlString in the Content delivery Api response?