In the docs I found the part "Generating HTML" for the rtf-field.
But where should I call this function from my collection config?
This is my config for my rtf field:
{
name: 'content',
type: 'richText',
required: true,
label: 'Content',
admin: {
elements: [
'h2',
'h3',
'h4',
'h5',
'h6',
'link',
'ol',
'ul',
'upload'
],
leaves: [
'bold',
],
}
},
Hey @danielkraemer - the "Generating HTML" example you are seeing is done on your front-end to render JSX from your richtext content defined in your config.
Here is how we are setting up our RichText field on our website cms, as well as, how we then render our richtext on the front-end of our website
-
https://github.com/payloadcms/website-cms/tree/main/src/fields/richText-
https://github.com/payloadcms/website/tree/main/src/components/RichTextLet me know if this helps!
@patrikkozak thanks
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.