# Embed Content Types within rich text in Contentful

When using either @contentful/rich-text-html-renderer (opens new window) or @contentful/rich-text-react-renderer (opens new window) to render your rich text, you can add options to the function in order to handle specific cases:

documentToHtmlString(document, options)

or

documentToReactComponents(document, options)

Here is an example of how the options variable should look in order to access fields from embedded content types:

let options = {
  renderNode: {
    [BLOCKS.EMBEDDED_ENTRY]: (node) => {
      const { image, caption } = node.data.target.fields
      return `
            <img class="img-fluid" src="${image.fields.file.url}" alt="${altText}" />
            <p class="blog-post-caption">${caption}
          `
    },
  },
}

In this example, the content type is always one with an image and a caption field.

You can access all the data of that content type by using node.data.target, then you can use it as you like and render it in html