Back to blog
Headless CMS 6 min read 0 views

How to Build Editable Landing Pages with Reusable CMS Sections

Keep your design in code and your copy in a CMS. Map section templates to your components, let marketing edit headlines and offers, and launch the next campaign page without a deploy.

Aditya Kadam Garchi CMS

An AI coding tool can produce a good landing page in minutes: hero, feature grid, testimonials, a sign-up button. Then marketing wants a different headline for a LinkedIn campaign. Next month the offer changes. The month after, someone wants the same page for a second audience with three lines different.

If every word lives in the component code, each of those requests goes through a developer or an agent with access to your repository. You're paying for a release process to change a headline.

Reusable CMS sections fix this without handing your design to a page builder. Developers keep control of layout, styling and behaviour. Editors control the values inside each component. This guide shows how to set that up with Garchi CMS, which we build, on top of a frontend you already have.

Template, section, page

Three terms do all the work here.

  • Section template: the blueprint for one component. A Hero template lists the fields your Hero component accepts, such as heading, supporting_text, image and button_label. In Garchi, the template's name matches the component's name.
  • Section: one use of a template on one page, with its own values. The homepage hero and the campaign hero are two sections of the same template.
  • Page: a URL with a title, a meta description and an ordered list of sections.

Reusing a template doesn't make pages identical. The same Hero component renders different words and images on each page, and your code can still offer variants you build on purpose.

Build the smallest working page

Start with three page-level templates, plus one small child template for the feature cards. That's enough to prove the workflow without designing a whole system.

TemplateProps and types
Heroeyebrow (text), heading (text), supporting_text (longtext), button_label (text), button_url (text), image (media)
FeatureGridheading (text), intro (longtext). Holds FeatureCard sections nested inside it.
FeatureCardtitle (text), description (longtext), icon (text)
CallToActionheading (text), button_label (text), button_url (text), style (select)

Give the style prop a fixed list of allowed values, for example primary,secondary. Editors and agents then pick from your options instead of inventing new ones.

Create the templates under Structure → Section Templates in the dashboard, or ask a connected AI agent to create them from your component files. Then create a page at a path such as /campaign/founders, add the Hero, FeatureGrid and CallToAction sections, nest three FeatureCard sections inside the grid, and fill in the values.

Connect sections to components

In your code, map each template name to the component that renders it. Fetch the page on the server, walk through its sections in order, and pass each section's props to its component. A React version of the map looks like this:

import Hero from "@/components/Hero";
import FeatureGrid from "@/components/FeatureGrid";
import FeatureCard from "@/components/FeatureCard";
import CallToAction from "@/components/CallToAction";

const components = { Hero, FeatureGrid, FeatureCard, CallToAction };

export function Sections({ sections }) { return sections.map((section) => { const Component = components[section.name]; if (!Component) { console.warn(No component for template ${section.name}); return null; } return <Component key={section.id} {...section.props} />; }); }

The exact shape of the page response, and how nested sections arrive, depends on the SDK or API version you use, so check the Garchi documentation before you copy this. The FeatureGrid component would render its nested FeatureCard sections with the same map. Starting from scratch? The Garchi starter kits for Next.js, Nuxt and Laravel ship with this template-to-component mapping already in place, so you only add your own components.

Three rules for the integration:

  • Handle unknown templates. Log and skip them instead of crashing the page.
  • Keep the API key on the server.
  • Set the page's title and meta description from the page record, so each campaign page gets its own.

Let editors edit, and keep the page stable

Now hand the page to someone in marketing. They open it in the dashboard, change the hero heading and the button label, and save. They don't need to know JSX, Vue or Git.

Edits put the page into draft. Your live page keeps serving the last published version until someone publishes the new one, so a half-finished edit never shows up on the site. If you set up draft preview on your frontend, the editor can check the change in your real design before publishing. Garchi also documents a live editor for in-context editing.

Developers keep the decisions that belong to them: how the button looks, how the feature grid collapses on mobile, and whether a new component is worth building.

Let an agent build campaign variants

With an AI client connected to Garchi over MCP, you can ask for a variant in one prompt:

In my Website space, create a page at /campaign/agencies based on /campaign/founders. Use the same Hero, FeatureGrid, FeatureCard and CallToAction templates. Rewrite the copy for agency owners who manage client sites. Don't create new templates and don't change /campaign/founders.

The agent builds the page from your existing templates and saves it as a draft. You review the copy and publish. No code changes, and no new components to maintain.

Mistakes to avoid

  • Exposing styling as content. Props such as padding_top or font_colour turn editors into designers and break consistency. Use semantic fields and a few deliberate select options.
  • One template per campaign. If every page gets its own Hero variant, you lose the reuse that made this worth doing.
  • Giant all-purpose templates. A section with thirty optional props is hard to fill and harder to review. Split it.
  • No written guide. Note what each template is for in its description. People and agents both pick better components when the purpose is written down.

The real test is the second campaign

Launch the first page. Then build a second one for a different audience using only the existing templates. Check it on mobile and desktop, publish it, and ask an editor to correct a line on it.

If the second campaign went live faster than the first and without a developer, your sections are doing their job. For the thinking behind template and field names, read how to structure website content for AI agents.

Create a free Garchi space and build your first editable landing page

Enjoyed this article?

Get the next one in your inbox, with new Garchi features and practical ideas for running content operations with your team and AI agents. No spam, and you can unsubscribe at any time.

We only use your email to send the newsletter. Read our Privacy Policy.