Prompt

How do I build reusable content blocks in a headless CMS?

Technology / Developer Tools1 observationLast seen Oct 20, 2026

Latest observation

Oct 20, 2026OpenAI APIWeb search: off

Reusable content blocks in a headless CMS are usually built by designing modular content types that can be mixed and matched across pages, then rendered by your frontend based on the block type.

Core approach

  1. Identify repeatable UI/content patterns

    • Hero
    • Text section
    • Image gallery
    • CTA banner
    • FAQ
    • Testimonial
    • Product card list
  2. Create each block as a component-like content model

    • Each block should represent one discrete piece of content.
    • Keep it focused and reusable.
    • Example: HeroBlock, QuoteBlock, CallToActionBlock.
  3. Use a page model with a flexible content area

    • Instead of hardcoding fields like headline, body, image, create a contentBlocks field.
    • This field is usually a repeatable list/array of block references or inline objects.
  4. Render blocks dynamically in the frontend

    • Fetch the page data.
    • Loop through the block array.
    • Switch on the block’s type and render the matching component.

Common modeling patterns

Option 1: Modular blocks inside a page

Best when blocks are only used within pages.

{
  "title": "Homepage",
  "blocks": [
    {
      "type": "hero",
      "heading": "Welcome",
      "subheading": "We build software",
      "ctaText": "Get Started"
    },
    {
      "type": "textSection",
      "heading": "About Us",
      "body": "We help teams..."
    }
  ]
}

Option 2: Separate reusable block library

Best when the same block can be used in many places.

  • HeroBlock
  • PromoBlock
  • FeatureListBlock

Then pages reference them by ID or relation.

Option 3: Component-based schema

Some CMSs let you define a “union” or “dynamic zone” of components.

  • Contentful: modular content
  • Strapi: dynamic zones
  • Sanity: portable text / array of objects
  • Prismic: slices
  • Storyblok: blocks

Best practices

Keep blocks atomic

Make blocks do one thing well.
Bad: a “homepage block” with 20 fields.
Good: separate hero, CTA, testimonial, etc.

Use shared fields where possible

Create reusable field groups like:

  • SEO metadata
  • Link object
  • Image object
  • Button object

This reduces duplication and makes content easier to maintain.

Add a type discriminator

Each block should include a clear type so the frontend knows how to render it.

{
  "type": "cta",
  "text": "Book a demo",
  "link": {
    "label": "Contact us",
    "url": "/contact"
  }
}

Validate block-specific requirements

Each block should enforce its own rules:

  • hero requires heading
  • image block requires alt text
  • CTA requires link or button

Plan for editor experience

Make sure non-technical editors can:

  • reorder blocks
  • preview blocks
  • duplicate blocks
  • see clear labels in the CMS

Frontend rendering example

function Page({ blocks }) {
  return blocks.map((block, index) => {
    switch (block.type) {
      case "hero":
        return <Hero key={index} {...block} />;
      case "textSection":
        return <TextSection key={index} {...block} />;
      case "cta":
        return <CTA key={index} {...block} />;
      default:
        return null;
    }
  });
}

Things to watch out for

  • Too many block types: makes editing and rendering messy.
  • Nested blocks without limits: can become hard to manage.
  • Inconsistent field names: makes frontend logic brittle.
  • No fallback/default handling: content may break if editors omit a field.
  • Overly generic blocks: if a block can do everything, it usually does nothing well.

Good rule of thumb

If you find yourself repeatedly copying the same content structure across pages, it’s a good candidate for a reusable block.

If you want, I can also show:

  • a Strapi example
  • a Contentful example
  • a Sanity schema example
  • or a recommended block architecture for a specific project type.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.