Creating editable content blocks in Contentful that are not part of a "Content Type"

504 views Asked by At

Here's my scenario. My client's homepage has an introductory paragraph, and then a list of portfolio projects. I need both to be editable.

The list of projects is easy: I create a "Projects" content type and then each entry is fully editable.

But what about the intro paragraph? If I create an "Intro" content type, then my client can create/publish multiple entries of type "Intro", and I don't know how we'd know which one should be displayed.

Alternatively, following the logic in Contentful's Look Book tutorial I could create a container content type called "Home Page", with specific fields/reference fields giving me complete control over what appears. As a bonus, reference fields make sorting of the project list simple.

But what happens when the client creates multiple entries of type "Home Page"? I foresee the same confusion: which entry is the home page that should be displayed on the live site?

Thanks in advance for helping me grok this, or pointing me to info that will help me.

1

There are 1 answers

2
Robban On BEST ANSWER

This is a common problem among almost every CMS I've worked with. You have certain content that is "global" and should not appear more than once. It could be things like the top menu, the start page text, settings for news feeds or footer content.

In many traditional CMSs you have the notion of a "StartPage" that often ends up being the container for such settings.

In Contentful you do not have the notion of pages as such, but your idea to create a "Home page" content type would work perfectly well in this situation. What you could do to limit the editors possibility to create more than one "Home page" is to make sure their role does not have access to create them.

Start by creating a "Home page" entry and then limit their role to only be able to create "Projects".

enter image description here

These settings can be found under settings -> roles