Reuse what’s reusable. You might notice that some content types contain similar or even the same elements. Don’t duplicate, reuse instead. Plus, you can get a glimpse at what relationships your content types have to connect with other content.
Reuse repeated content and elements
Repeated content
In the example content model, there are several places where repeated content is:
Blog post contains an author, that will be repeated (one author usually writes many articles).
Images are usually used in multiple places with the same title and alternative text.
The main criterion is if the set of values for the element overlap. In that case, consider creating a separate content type representing the given set. On the example website, there is also a listing of all authors and a filter set up, so it makes even more sense to create a separate content type for them.Images and other assets are usually distributed with additional information. It can be a title, an alternative text, or even tags. That’s why it’s suitable to create a content type called Asset that will contain the asset itself along with all the necessary information. The biggest advantage is that this implementation can be later easily extended.
Repeated elements
Again, in the example content model, there are several places with repeated elements:
All widget types contain How widgets work, Title, and Subtitle.
Article and Blog post contain Title or Body copy.
If the set of elements is only repeating without sharing the given set of content, consider usingcontent type snippets. They allow you to create a repeating set of elements for multiple content types.The widgets in the example are suitable to be used as a content type snippet as the content in them won't be the same but they are going to be always used together as all widgets relate to each other.On the other hand, you can see that for Article and Blog post, the Title and Body copy stayed separate. Even one element can be created as a content type snippet but in this case, we decided to keep them separate as the elements could later change independently of each other.
Repeated content
Connect the content types with relationships
One of the first sentences in this tutorial said that content models are mainly about relationships among content types. This step will be mainly about noting them in the diagram.
Sign in with your Kontent.ai credentials or sign up for free to unlock the full lesson, track your progress, and access exclusive expert insights and tips!
If you have an element with a part of the content that repeats a lot (like https:// in URLs), set a default value for the element.When you create a new content item, the element gets pre-filled with the default value, and you can adjust it if needed.You can set default values for the asset, custom element, date & time, linked items, multiple choice, number, subpages, taxonomy, and text elements.Remember, if an element repeats with content as a whole, convert it to a content item and reuse it like that.
If you already know database relationships, content model relationships are practically the same.