Contentful logo

Contentful Community

Repeater / flexible content field?

#1

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

#2

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?

0 Likes

#3

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”.

2 Likes

#4

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.

0 Likes

#5

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

0 Likes

#6

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

0 Likes

#7

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.

0 Likes