Contentful logo

Contentful Community

How to deliver individual text blocks or images in react + contentful?

Suppose I have 3 plain text blocks and 3 images all attached to the same content model. How do I deliver each at the time with out mapping.

For example: I want to deliver one text block and an image at a given page of my choice but both independent of the other.

Thanks in advance

If I don’t understand wrong; You might have a few options…

  1. You can change your content model → {text, image} and multiple your entry…
  2. You need to filter them on the request… If you can’t change your model, I recommend that. Otherwise you would be getting all the images in the response body.
  3. You can think creating a content model for the page, and use whatever you’d like. You don’t have to use a generic content model for each item… but this is very high-level architectural decision.

Thanks,I will try to implement each of the options provided to establish that may suit my needs.