0

Does contentful offer a way to create reusable custom components?, I've looked around and it seems they only offer content types which are like entire page templates. In their article on migrating from Prismic to Contentful they mention that slices are treated as custom types, but you can't use custom types inside custom type, so doesn't seem like a good solution.

I'm basically looking for a way to create custom field groups that I can use across multiple content types.

Ferran Buireu
  • 28,630
  • 6
  • 39
  • 67
Samuel Anyanwu
  • 295
  • 3
  • 12

1 Answers1

2

Contentful DevRel here.

content types which are like entire page templates

In Contentful content types are whatever you define them to be. An entry of a particular content type can hold page information, but can also hold information about a single component.

We recommend to structure your content into reusable components. This way content stays reusable.

So while Contentful doesn't offer something like Prismics slices you can achieve similar results with Contentful types and a thought through content model.

You could potentially define a gallery content type which in your code is coupled to a gallery components and then reference it from within another entry of e.g. a page content type. This is where the power of content modelling comes into play – you can create a custom content graph tailored to your needs quickly.

As an example, it's really up to your what should be referenced from where. A page can reference galleries, authors or articles, which then can reference other custom entries.

page entry -- gallery - iamges
           |_ author
           |_ article - author
stefan judis
  • 3,416
  • 14
  • 22