Content Modeling Best Practices

Content modeling is the process of identifying fields and creating the structure of the content types, based on the website design. It involves picking the right fields to create the content type structure in the most optimized manner.

However, before you start with content modeling, make sure that you have the following in place:

  • Website design: This helps in content modeling. With proper website design, you will understand the frontend structure of your website, which makes it easier to define content types in Contentstack.
  • Knowledge of datatypes: Understand the functionality and intent of every element of the website, and what type of data it stores. For example, a call-to-action button is text with a hyperlink.

Once these things are in place, you can start modeling your content. Read about how to get started with content modeling.

While content modeling is considered to be an art that improves with practice over time, there are certain best practices that you can follow to make sure you model the content in the recommended way.

Use “Reference” fields for reusable content

If a piece of content is being reused in multiple entries, it’s best to create a reference field for that content. Let’s consider an example to understand this better.

‘Category’ should be a reference field in the Blog content type.

Let’s say you have a content type called ‘Blog’, with Category as one of the fields. Every time you create an entry, the value for this field is usually any one of these: Sports, Movies, Business, and IT. Instead of entering the value every time while creating an entry, it’s best to create ‘Category’ as a reference field, which refers to the ‘List of Categories’ content type.

Similarly, Author can be a reference field in the News content type of your news site. Size can be a reference field in the Products content type of your e-commerce site.

Use “Group” field for bunched items (banner, footer, etc.)

Many items on your website are usually bunched together. For example, a banner usually comprises an image, a title, some supporting text, and a call-to-action button. And footers usually consist of several columns of links.

Instead of creating separate, independent fields for each component in a set of bunched items, make them all part of a group.

So, in the banner example, add a Group field in your content type. Then, within the Group field, add a single-line textbox field (for the Title), a multiple-line textbox field (for the Description), a file field (for the Image), and a link field (for the call-to-action button).

If the bunched components are multiple in nature (such as three rotating banners), mark the Group field as Multiple.

Use “Modular Blocks” field for dynamic web pages

The Modular Blocks field lets you add multiple structures as blocks within a field. So, for example, you can add one block for a banner, one block for image and text, and another for videos. While creating an entry, the content manager can select any of the blocks, giving the content manager greater control over the structure of the page.

Let’s consider an example to understand this better.

You need to add two different structures to your content type: a “Banner” with description and background image and a “Video Gallery” with a video file and a CTA button. These structures will change dynamically on the web page.

Here, you can use a Modular Blocks field when creating your content type. Add one block for the Banner and another for the Video Gallery. You can use any of these two content structures while creating your entries. Thus, the Modular Blocks field allows you to use different types of structures for your webpages, providing dynamic content.

Suppose you need to add content for the “Homepage” and “About” pages of your website. You can create two entries for each of them. For the “Homepage” entry, you can select the “Banner” structure that contains a File field for background image and a Rich Text Editor field for some descriptive text. On the other hand, for the “About” page entry, you can select the “Video Gallery” structure that contains a File field for the video file and a Link field for a CTA button to take you to a particular link.

Reference vs Select

A Reference field allows you to create a reference to other entries, while a Select field allows you to choose one or more options from a list of predefined choices. These are two different fields servicing different purposes.

You can use the Reference field when you need to refer to entries of the same or different content types. An example of this is the ‘Author’ reference field in your Blog content type that refers to the entries of ‘News Authors’ content type.

On the other hand, when you need to just refer to a set of values that you can pick and choose from, you can use the Select field. For example, list of age groups or genders to select from.

Use of Boolean flags

If you wish to provide content managers with the ability to decide whether to show a piece of content on a webpage or not, it’s best to use a Boolean input field. A Boolean input field accepts a true or false value and shows up as a checkbox on your entry page.

A great example of this field would be using it to show if a product on your e-commerce site is ‘available’ or is ‘out of stock’.

RTE vs Markdown

The Rich Text Editor field accepts a variety of datatypes, such as text, images, and videos. However, the Markdown field accepts text only in markdown format, which uses markdown flavor to display content. Markdown text is essentially easy-to-read text that is marked with certain tags or formatting instructions.

Content managers who are familiar with basic datatypes find it easy to work with Rich Text Editor fields that help edit and format the content entered in the field without using HTML tags. They can choose whether to use HTML tags or directly edit and format content from the UI.

For example, it is best to use a Rich Text Editor field when you are looking to add descriptive text for a particular news article on a website.

On the other hand, developers who are familiar with markdown text can find it easy to work with Markdown fields.

For example, when your content manager is a developer who is familiar with the usage of markdown, it becomes easier to edit and format content entered in a Markdown field using HTML tags.

Building a complex navigation structure

When your website has a complex navigation structure, you need to manage several menus and sidebars used for navigating through your site. You can decide how many heading levels you require within your website’s navigation hierarchy. Depending on the levels of hierarchy, you can decide whether to use the Group field or the Reference field for your site navigation structure.

Use the Group field when your website has headings that flow upto three levels deep. However, for a website that has a complex hierarchy with headings that flow more than three levels deep, you can use the Reference field.

Let’s consider an example to understand how you can use Group fields and Reference fields to manage your side-navigation menus. Suppose you are preparing documentation for the different API calls used by your content management system (CMS).

Here, add a Group field in your content type. Then, within the Group field, add a single-line textbox field (for the Title of a section of your API documentation), a multiple-line textbox field (for a Description of that section), and a group field (for a description of the API calls). Within this nested group field, add a reference field (to pull in entries that contain content about several API calls) and a rich text editor field (for a description of the API calls, if needed). The nested group field will contain a reference to the different subheadings under the section.

If the bunched components are multiple in nature (such as three different API calls), mark the Group field at level one in hierarchy and the nested Group field as Multiple.

When you structure your content type in this way, you can easily keep adding references to independent ‘API call’ entries within your nested Group field. This will help update your API documentation with different API calls under new subheadings.

This technique allows content managers to create navigation menus with ease.

Was this article helpful?
top-arrow