Introduction
Contentful Rich Text fields use a JSON format called Rich Text, a proprietary format developed by Contentful. When you export content to a Contentful Rich Text field, Cloudpress will automatically convert the content to the correct rich text format. It will convert your text with the formatting, headings, tables, code blocks, etc. However, you may want to export custom content not supported by Cloudpress. For example, Contentful rich text fields allow you to embed other Contentful entries and assets via the Embed menu in the rich text editor.
Get the JSON representation of your Rich Text element(s)
First, you must get the JSON representation of the Rich Text elements(s) you want to export. You must install the JSON viewer application from the Contentful Marketplace to assist you. After installing and configuring this application, a JSON Viewer tab will be available when editing an entry in Contentful.


- The
fields
property contains all the fields for the entry. - The
body
property contains the value of thebody
field we are interested in. - The
en-US
property contains the value of thebody
field for theen-US
language. You may see a different value (or multiple values) depending on your locale(s). - Finally, the
content
property is an array that contains all the rich text elements. Each element will have an index, e.g.0
,1
, etc.

Export your custom Rich Text
To export the Rich Text elements, you must define a raw content block using the@@begin_raw_content
and @@end_raw_content
processing directives.
- Denote the start of a raw content block by by adding the
@@begin_raw_content
directive to your document. - After that, add the JSON for the Rich Text element(s)
- Finally, close off a raw content block, use the
@@end_raw_content
directive.

@@begin_raw_content
and @@end_raw_content
directives as raw content and will export it to Contentful as-is. It is therefore important that the content you specify is valid JSON. If not, Contentful will prevent Cloudpress from exporting the content.
When the document in the screenshots above is exported to Contentful, it will result in the correct Rich Text content being created.
