Baack

Content modeling best practices: model content, not page layout

Browse the docs
Developer

Content modeling is deciding what your content is made of: the kinds of content you have, the fields each one carries and how pieces refer to each other, so the same words can serve a website, an app and an email without being rewritten for each. This guide sets out content modeling best practices for a headless CMS using Baack's content matrix, with real examples from www.baack.co, which is built on it.

If you have spent any time building digital products with modern Headless CMS platforms, you have likely run into the nested schema trap.

You start with a simple page layout, build a component hierarchy in your CMS schema, and before you know it, your API responses are filled with deeply nested arrays of "slices," "blocks," and "wrappers." Content becomes tightly coupled to visual presentation, rendering your content model rigid, fragile, and difficult to query across multiple channels.

Baack takes a fundamentally different approach to content modeling. Instead of forcing your content into arbitrary nested trees that mirror front-end page structures, Baack decouples content from presentation using a Sparse Content Matrix.

Concepts

The Established plan card from Baack's pricing page with each content item outlined and labeled by type, name and sort order, the same entity's items as a matrix of names by sort order, and the same entity again as a row in the pricing table

  • Entity: represents a page like set of content e.g. a blog post or in the app context an Android main view fragment or iOS app UI View Controller. The content entity groups together all of the content needed for the presentation of a screen or view. You can use multiple entities in the same rendering context with one entity per content fragment. In frameworks like Astro you may decide to use an entity per island for example to hold the content for the navigation or menu for a separate component.
    • Entity names are addressed with a folder / directory name and file name e.g. /home
    • Entities have a locale associated with them e.g. en-GB. You may have multiple entities with the name /home with different translation locales to allow delivering different localized experiences dependent on the language preference of the user.
    • Entities have a variant to allow personalization and experimentation. The default variant is "" (none) which is returned when no alternative variant is selected or available.
  • Item: Entities contain a collection of items of different types which are strongly typed. The most primitive content type is text and each content entity typically has a large number of text items. Items are typically accessed in an entity context via the collections of items returned when reading the entity.
    • Items are named as the combination of their name field and the sortOrder field to allow them to be accessed in a matrix.
    • Different types of content items are returned in the strongly typed collection fields of an entity.

Here is how the Baack content matrix approach works and why flattening your content model unlocks better performance, flexibility, and developer experience.

Page/entity-level content, not arbitrarily deep component trees can make it seem like validation of content shapes in a collection could be a risk, that's why the console warns content owners about differences in shapes of content across languages, variants or collections. These warnings will be enhanced in future versions of the platform with custom validation rules for content owners.

If truly nested content is required then entities do support arbitrary JSON fields as a fallback.

A note on entity relationships and validation

The matrix model is optimized for what lives inside an entity, flat, strongly typed, sequenced content. It is deliberately not trying to be a relational database while avoiding the need to define schema and manage migrations when the schema changes. JSON support does allow arbitrary data structures as a fallback.

For content reuse use references (e.g. an author bio link used by multiple posts, a product referenced from multiple pages), the recommended pattern is to model the shared content as its own entity and reference it from the consuming entity, rather than duplicating or nesting it inline. This keeps the matrix flat while still giving you a single source of truth. Experiences are then built by composing entities together at read time, not flattening everything into one giant record or nesting content arbitrarily leading to duplication.

Similarly, the matrix intentionally pushes field-level business rules like required fields, length limits etc out of the schema layer and into separate rules, your front-end or edge logic. The admin console does offer warnings when an entity in a group is missing item fields missing in its peers. We will also offer this capability via the API via warnings (coming soon). This is a trade off worth naming plainly: you gain a content model that never needs a migration when your validation rules change, at the cost of validation living at a different layer rather than mixed in the content. For teams with lightweight editorial governance this is a net win. For teams that need strict, centrally enforced content contracts, pairing the matrix with a thin validation layer with rules driven by webhooks supports that guarantee without reintroducing nested schema debt.

1. The core concept: The sparse naming matrix

At its heart, every Baack Entity represents a page-like collection of items. Rather than constructing a complex object tree, content within an entity is modeled using a sparse two-dimensional matrix.

Each content item within an entity is defined primarily by two key properties:

  • Name (string): An arbitrary string serving as the key for the item.
  • Sort Order (integer): An integer value defining the sequence or row position.

A content text item may look something like:

{
  "urn": "...",
  "url": "/n/v1/textitem/...",
  "name": "hero_title",
  "sortOrder": 0,
  "value": "Build Better Digital Experiences"
}

Best practice: Use web-friendly identifiers

While name can technically be any arbitrary string, the recommended best practice is to use identifiers compatible with HTML IDs or CSS class names (e.g., kebab-case or snake_case like hero-title, pricing-col-pro, author-bio).

By adhering to browser-native naming conventions, consuming content on the front end becomes effortless. Your content keys map directly to DOM identifiers, design system token names, or component prop targets without complex transformation pipelines.

Why flat beats nested every time

  • The anti-pattern: Most headless CMSs encode the visual layout directly into the schema (Page -> Section -> Grid -> Column -> Component). When design systems update or new platforms (like mobile apps, digital signage, or AI agents) consume the API, these layout-encoded schema become dead weight.
  • The Baack content matrix approach:
    • Zero schema pollution: The API returns flat, predictable data structures regardless of layout complexity.
    • True Omni-channel readiness: Content remains pure data. Front-end frameworks decide how to lay out items based on name and sortOrder, leaving the content schema clean. This is critical for supporting content across different types of devices where the nesting of the schema may not be consistent.
    • Effortless schema maintenance: Adding a new field or content block doesn't require rewriting complex nested relational schema or re-nesting migrations.
    • Easier for AI agents: Matrix tabular data is much easier for AI agents to consume. By breaking the content down into smaller chunks tasks like translation or refinement become much easier as the agent doesn't have to understand the semantics of nesting of the content encoded into the schema.

2. Practical example 1: Modeling a standard blog post

To see this in action, let's look at how a typical blog post entity is structured using the Baack matrix.

Instead of nesting title metadata inside a header wrapper and body content inside a rich_text_block container, the blog post entity simply houses strongly typed items side-by-side:

Name Type Sort Order Content / Purpose
meta-title text 0 SEO page title
meta-description text 0 SEO Meta description
banner-image image 0 Featured header image asset
article-body markdown 0 Full long-form post content

Because items are strongly typed, your front-end web app or mobile SDK knows precisely how to parse and render each piece of data without needing to traverse a deep component tree. This also helps simplify the components rendering the content.

To see how the SEO items reach the page, as titles, descriptions, canonical and hreflang links and structured data, read SEO for a headless CMS.

3. Practical example 2: Unlocking 2D layouts (pricing tables)

Because the matrix naturally supports two dimensions (name * sortOrder), rendering tabular or multi-column data becomes trivial without needing special "table" field plugins or nested arrays.

Consider a Pricing Table:

  • Use the name field to represent the Column (e.g., SKU, plan, key-feature, price).
  • Use the sortOrder field to represent the Row Number (e.g., 0 for the free plan, 1 for the pro plan).

Built-in strongly typed field powers

Baack entities support specialized, strongly typed primitives out of the box. For instance, pricing models benefit directly from the native money item:

  • Supports all currency codes: Standard ISO 4217 support (USD, EUR, GBP, JPY, etc.).
  • Built-in formatting outputs: Automatically returns sanitized values and localized string representations for display.

The entity and its items may look like:

{
  "urn": "...",
  "name": "/pricing",
  "texts": [
    { "name": "SKU", "sortOrder": 0, "value": "FT1" },
    { "name": "plan", "sortOrder": 0, "value": "Free tier" },
    { "name": "SKU", "sortOrder": 1, "value": "PP1" },
    { "name": "plan", "sortOrder": 1, "value": "Professional plan" }
  ],
  "booleans": [
    {"name":"key-feature","sortOrder":0,"value":false},
    {"name":"key-feature","sortOrder":1,"value":true}
  ],
  "money":[
    { "name": "price", "sortOrder": 0,"currencyCode" : "GBP","unitValue" : 0,"formattedValue" : "0.00","currencySymbol" : "£"},
    { "name": "price", "sortOrder": 1,"currencyCode" : "GBP","unitValue" : 2500,"formattedValue" : "25.00","currencySymbol" : "£"}
  ]
}

Rendering this on the front end simply requires grouping by name or sorting by sortOrder, no complex data flattening logic required. The API also provides helpful currency formatting and symbol values that make building schema.org tagging a breeze.

4. Real examples from www.baack.co

The examples above are illustrations. These two run this website, and editors change them on the live page with the in-page editor.

A comparison table as a matrix

The content management page compares traditional, decoupled and headless CMSs in a table of six rows and four columns. In the page's entity the whole table is three kinds of name, with the sort order as the row:

Name Sort orders Holds
architectures_column 0 to 3 The column headings: Traditional CMS, Decoupled CMS, Headless CMS and Baack
architectures_row 0 to 5 The row headings, such as "Who renders the pages"
architectures_cell_0 to architectures_cell_3 0 to 5 One name per column; the sort order is the row

So the Baack column's cell in the "Channels" row is architectures_cell_3 at sort order 1:

{
  "name": "architectures_cell_3",
  "sortOrder": 1,
  "value": "Any, with channel variants for the content that differs between them."
}

Rendering it takes two loops and no table plugin:

const view = EntityView.from(entity)
const columns = view.texts("architectures_column")
const rows = view.texts("architectures_row").map((row) => ({
  header: row.value,
  cells: columns.map((_, column) => view.text(`architectures_cell_${column}`, row.sortOrder)?.value),
}))

The cell names carry a column number rather than the heading's words, because the headings are content: an editor can rename "Baack" or "Suits" without breaking the table. Adding a row is adding items at the next sort order, with no schema change and no migration.

Orders editors change: keyed lists

The FAQ groups its questions, and editors reorder them. Each question's items are named by a stable key, such as faq_graphql_question and faq_graphql_answer, so moving a question never renames anything. The order is a separate list: text items named group_building_faqs, one per sort order, whose values are the keys in order. Moving a question rewrites the list, not the questions, and a new question that isn't in the list yet still shows, after the listed ones. The page's sections are ordered the same way, by a sections list.

5. Entity organization: file-system routing style

Content modeling isn't just about what lives inside an entity; it's also about how entities relate to each other across your site hierarchy.

Baack entities utilize file-name/path-like naming conventions (e.g., /blog/2026/content-modelling-best-practices or /products/pricing).

This directory-based hierarchy provides two major benefits:

  1. Native directory structure: Your content repository naturally maps to URL routes or file-system routing patterns popular in frameworks like Next.js, Remix, or SvelteKit. Using the client you can resolve the path for the entity right from the URL.
  2. Contextual scoping: Querying all articles in a specific folder (e.g., /blog/*) is built directly into the core routing paradigm. This keeps content organized and easy to find.

6. Best practices for any content model

Most content modeling advice applies whatever CMS you use. Here is how each point works out on Baack.

  • Model what content is, not where it sits in a design. Name items for their meaning (price, plan, author-bio) rather than their place in today's layout (left-column-text). Position belongs in your components; a table's row and column are the exception, because there they are the meaning.
  • Share, don't copy. Content used in several places, such as an author or a product, gets its own entity, referenced from the pages that use it.
  • Keep every language and variant the same shape. Each language and variant is its own entity with the same item names, so one component renders them all. The console's Compare view lines them up item by item and flags what one has and another lacks.
  • Start small, and add items when you need them. A new field is a new item name, not a schema change, so there's no migration to plan before an editor can use it.
  • Model with the people who edit. With in-page editing, editors work on the page rather than on names, but the model decides what they can change on its own: a price that's its own money item can change without touching the sentence around it.
  • Keep the model where your code is. On this site, each item's name and its en-GB placeholder sit in the component that renders it, so the code documents the model, and a sync script creates any items a page needs that its entity lacks.

Summary checklist for content modeling best practices on Baack

  1. Keep It Flat: Resist the urge to nest. Use name and sortOrder to group and sequence content items.
  2. Use Browser-Compatible Names: Name items using HTML ID/class friendly string keys (kebab-case or snake_case).
  3. Leverage the 2D Matrix for Arrays & Grids: Map matrix coordinates directly to UI rows and columns for components like pricing tables or feature grids.
  4. Utilize Strongly Typed Items: Take advantage of native primitives like money, image, and markdown for cleaner front-end consumption and built-in formatting.
  5. Organize via Path Conventions: Treat entity names like system file paths for straightforward routing and folder-based content organization.
  6. Use Keyed Lists for Orders Editors Change: Name items by stable keys, and keep the order in a separate list of keys.
  7. Reference Shared Content: Give content used in several places its own entity, and reference it rather than copying it.
  8. Keep Languages and Variants the Same Shape: Use the same item names in every language and variant, so one component renders them all.