Streaming live at 10am (PST)

JSON schema from CMS

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

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

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">


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

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!

Hi you two, question:

  1. I see ability to add a “code” block to the RTF, but do not see a way to then also have the RTF CMS entity populate within the RTF field.

How are you both selecting “code block” and having the RTF field read data from the CMS?

Could you add a gif or some screen shots?