Content modeling in Contentstack is the process of defining the structure of your content types to ensure efficient, reusable, and scalable content management. There are certain best practices that you can follow to make sure you model the content in the recommended way.
Before starting with content modeling, ensure you have the following:
Now, let us explore the best practices for effective content modeling.
Before creating content types, it is essential to understand your website or app’s design structure. Reviewing detailed wireframes or mockups helps you identify content components and their relationships.
Thoughtful planning prevents redundant content types and simplifies future updates.
Do not use reserved keywords in unique identifiers (UIDs). Refer to the Restricted Keywords for UIDs document for a complete list. This ensures smooth API query execution and avoids potential issues.
Note: Refrain from using hyphens (-) in content type UIDs.
Reference fields allow you to link entries across different content types, promoting consistency and reusability. This field type is ideal when you have data shared among multiple entries. Consider the following use cases where Reference fields can be effectively utilized:
Example: In a Product content type, use a Reference field for Recommendations to suggest related products.
By using Reference fields effectively, you can manage content relationships with ease, improve data reuse, and maintain consistency across entries.
Group fields help organize related fields into a single, reusable structure. This is useful for components such as banners, footers, and call-to-action sections where multiple elements are grouped together.
For instance, a banner component could consist of the following elements:
When you use Group fields, you improve organization by keeping related content bundled together. For multiple instances of grouped components, enabling the Multiple option helps maintain flexibility. Nesting Group fields within each other allows you to manage more complex structures easily.
Modular Blocks provide flexibility by allowing content managers to dynamically select and arrange different content structures within a single field. This is particularly useful for pages with varying layouts.
You can set up a Modular Blocks field that includes the following block types:
Using Modular Blocks enables content managers to customize page layouts without developer intervention. It supports scalable and dynamic content delivery.
Additional Resource: Refer to the Modular Blocks – Real World Scenarios guide for practical examples.
Global fields allow you to create a set of fields once and reuse them across multiple content types. This is ideal for fields that need to appear consistently across different content types.
For example, you can create an SEO Global field that contains the following fields:
Using Global fields ensures consistency across content types. It reduces redundancy by allowing you to manage shared fields in one central location, simplifying updates.
Custom fields allow you to create unique input types that go beyond the default options provided by Contentstack. These fields are ideal when you need to accept custom data types or create visually distinct inputs. Here are some examples of custom fields:
Tip: Use Custom fields strategically to extend Contentstack’s capabilities while keeping content types manageable.
Understanding the difference between Reference and Select fields ensures you choose the right tool for your content needs.
Tip: Choose Reference fields for dynamic content relationships and Select fields for static choices.
Boolean fields are perfect for managing simple true/false conditions. These fields provide a checkbox interface, making them easy to use for content managers.
Example: For an e-commerce store, use a Boolean Field named “Availability” to indicate whether a product is “Available” or “Out of Stock.”
Boolean fields streamline decision-making and ensure clarity in content management.
Contentstack offers multiple Rich Text Editor (RTE) options to support diverse content formatting needs.
Tip: Select the appropriate RTE based on the complexity of your content requirements.
When designing complex navigation structures, it is important to use the right field type based on the hierarchy depth.
For example, add a Group field in an API Reference content type to manage navigation efficiently. Inside the Group field, include:
This structure helps you manage navigation elements efficiently and ensures flexibility.
Entries in Contentstack are identified by a unique alphanumeric string called the Entry UID. While it is possible to use UIDs in your code, this is not recommended because UIDs change during stack migrations.
Instead of relying on UIDs, reference entries by using a unique, immutable field such as the Title field or a custom identifier.
Example using the Title field:
<a href="/blogs/contentstack-headless-cms">Contentstack Headless CMS</a>Using unique fields ensures your code remains portable and reduces the need for extensive updates during content migrations.