Repeater / flexible content field?

Hello contentful community!

I just arrived from working primarily with wordpress as backend. Enjoying contentful a lot, but one question:

In wordpress I often use the repeater field from the Advanced Custom Fields plugin to allow flexible layouts, and I am now trying to figure out what is the best way to achiev something similar with contentful.

To exemplify, for a site I am currently working on I would like this:
I define a couple of different subsection-types: text, images, embed, etc…
I would like the authors/editors to be able to add an arbitrary number of fields of these subsection-types, and drag and drop to change the order.

I now do this with a multi reference field, and created post types for the different subsections/components.

This works! But somehow feels a bit messy (for the editors), with the “sub-content” showing up in the list of all entries etc…

How would you guys go about this?

1 Like

Hello! :wave:t2:

What you could do is to improve the editor experience by setting custom views for them.

You can save every search in the web app as a view and then make these views available for the editors.

This way the editors know how they can access certain types quickly. Would that help?

This is the same problem I have.

The CMS user is building a page (i.e. composing the content of a page) in the Content Composer field, by selecting from a number of preconfigured types for a page.

So in the example above, the content of this page consist of:

A text block
An image
A text block

The thing that lacks with this is mainly from CMS user’s perspective. The “Card View” doesn’t give you much of a “preview” of what the content will actually look like.

I asked a similar question here: Controlling appearance in Card View

If we had more control over what the individual “Cards” looked like for each content type, it would actually make a half decent user experience. Like right now, the card for “Component: Image” is no help, like at all. It’s a blank image placeholder, the text “Untitled”, and the text “No description available”.

1 Like

Hello Jason,

while we’re not working on a repeater field (though we recently released some improvements that might help) there is a feature that we are currently building that, judging from your text-image-text example, you might benefit from.

It’s a currently in (closed) Alpha phase and it’s called Structured Text–it’s basically a rich text editor that will allow you to have this succession of text and [Blocks | Entries | Galleries | Images | etc]. Follow the link to sign up.

Let me know if you have any questions.

Hi @spiros,

May I ask why Contentful doesn’t have a repeater field? It would be a really handy feature!
My use case is for an elearning project where I have tons of questions (content type) with multiple choice answers. It would be really nice if we can add answers to the question content type instead of making a seperate answers content type.

Maybe a simple UI Extension that adds the answers to a JSON field could work. Do you know if there is such an extension already available?

Cheers!

Floris

Hello @helloflow,

A repeater field has indeed been asked for in the past but we haven’t prioritized it yet and it’s still not in our immediate next action items. I asked around and I was pointed to this extension: https://github.com/contentful/extensions/tree/master/samples/json-form-editor but I’m not 100% sure if that covers your use case.

Thanks.

Best,
Spiros

Hi Spiros! Is there any change on this? A repeater field is such a common need and I find it surprising that a robust CMS like Contentful wouldn’t offer one. I’m currently in the process picking a headless CMS to offer my clients moving forward, and I use repeater fields in almost all projects so this is a must.

1 Like

Also curious about the repeater field status… This would definitely help create a cleaner CMS experience for content users!

Agree, this is such an important feature. Most of the CMS out there support this one way or another. Any idea when would this come to live?

I think you can use repeater by using reference. you can define the type you want to repeat as a content model and then use a reference to it.

Hello, I’d also be really keen to see a repeater field, or flexible content type which didn’t rely on creating custom content types and linking through a reference field. Just wondering if this is under consideration for the future?

Thanks :slightly_smiling_face:

This is incredibly frustrating. After 3 years of requests, the unwillingness to implement this feature suggests Contentful don’t want to implement this feature. The effect of this is that I am going to move to another platform that offers me the feature flexibiility I need at a more reasonable price.

Shame really, because other than that I love Contenful.

1 Like

Hi - I’d like to pile onto this request. I’m evaluating Contentful now, and this might be a dealbreaker. We use ACF repeaters heavily in our current WP site, and this adds some friction to the decision.

+1 for the repeater field

Yep. I’m really surprised there isn’t a feature like this. It seems to me that Contentful are unwilling to roll something like this out, because to achieve a similar solution you would need to build extra content types and use them as references. Almost like they’re trying to make you hit that free tier limit so you will move to a paid plan.

1 Like

I can’t speak to why there’s no such field out of the box, but I just wanted to point out that it’s possible to build it yourself using the app framework. You could use JSON field as a storage mechanism, and then provide your own custom ui on top of it.

+1 for this feature.

Could you provide any more details or references/guides on this? I would love to give this a go over switching to some other system. Contenful is an otherwise phenomenal product and it took a while to settle on it!

Hey, all!

I have some good news. After looking at requests from the community, we have decided to launch the Repeater app on the Contentful Marketplace. The Repeater app makes use of a JSON field to create a repeatable list of items.

If you’d like to read more about the app, see our blog post:

If you’d like to download and try out the app, visit our marketplace to install it:

I hope this is helpful for those of you who were looking for this functionality. If you have any questions feel free to let me know or message me on the Contentful Community Slack which you can sign up for here:

https://www.contentful.com/slack/

Happy coding!
David

2 Likes

Hey, Cell, :slightly_smiling_face:

This is a common challenge I’ve seen Contentful users face, and it makes a lot of sense why it’s not immediately clear. The logic behind content modeling reflects web design and database modeling in a lot of ways, and these are skills people study for years to master!

To create flexible layouts on your site, I would suggest making a few core content types and building from there. Here’s a content model I’ve created that can help you get that process started:

Let me know if there’s any way I can help further, or if you have questions.

-Connor

2 Likes