Streaming live at 10am (PST)

JSON schema from CMS

I store schema.org schemas in a CMS field and add them to the page with

<script type="application/ld+json">
(CMS field here)
</script>

Besides the fact that this field is inside the script tags, Webflow converts all commas characters to &quot;.

How can I avoid this? Thank you in advance.

Either decode the encoded content or use a rich text field to place an embed which contains your schema data. Webflow does not encode that.

Thank you for so quick reply! Can I decode the content right inside this block?
<script type="application/ld+json">

</script>

You can with code but the latter method I suggested is much easier.

:+1:
Thank you so much!

Perhaps I didn’t understand something, but the rich text field can’t be added to the custom code.

Rich text fields can have custom code embedded in them (<> symbol). See the University. You basically are using it as a container to hold code since Webflow will not encode the contents. It is a workaround that works.

Thank you. I understand it can contain a code, but I don’t understand, how can I add this rich text field to the page template custom code with the +Add Field. This function doesn’t show rich-text fields. Or I shouldn’t add it there, and I can add a hidden rich-text element with this field somewhere in the body with the page designer?

Yes this is the approach. You need to put your JSON in the RTF custom code. Then render the RTF on the page as a RTF element.

It worked! Thank you so much!