Contentful logo

Contentful Community

Single Entry Content Model

Hi All. I’m new in Contentfull so will appreciate for your help.
So I have dynamic pages, like About Me, Team, etc.
Ant this pages have a different fields:
About Me:

  • My Bio
  • Specialities
  • History

Team:

  • Team Description
  • Goal/Mission

How should I create my models.

  1. Can I create a model type Pages and setup it somehow where the different entries will have different field sets? When I will add About Me item there will be some fields.
  2. Or maybe I can create two different content models with own fields, but where I can add only single item, not multiple.

Thank you!

I’d recommend you think about how you want to use your content beyond the page level. I would treat each thing as an object and then add objects to pages. For example. Maybe create a “me” object that holds all your information. Or a person object that holds you and other people in the future. Then create a team object. Then have a page object that can hold various objects inside of it. The key is to make your content model scalable and future proof. I have a free video you can watch (I presented it at Blueprints 2020) - https://www.youtube.com/watch?v=hrSMjkdgeuA

1 Like

Thank you! Yes, I understand that I have to think in Content Model development.

I watched your entire video. Thanks, it was really insightful.
Though even you mentioned in your video that you considered making your footer contents editable. And that is an example of something that would only have 1 content.
So how would you make those?
My best idea right now is to just create a content type e.g. footer, and include “(single content)” in the label to signal to the authors that they should keep that at 1 content entry.

For anyone else coming here with a similar issue, I figured out a way to do this.

Create a new text field (Symbol) that uses the slugEditor interface and then set these validations:

  • make it required
  • make it a unique field
  • accept only specified values, and here is the crucial part: only add one value to that list

There can only ever be one item in that content type because of those validations.

This means you can query for that content using the value you set in this new field, e.g. footer like in the screengrab below.

Hope that helps