Skip to content

Pages and Blocks

Alongside the headless content API, the CMS can hold pages composed from blocks, so editors can build a page without a developer. A frontend renders them; the CMS stores and serves them.

  • Pages. A page has a literal route (for example /about), a title, a draft or published status, an optional scheduled publish time, and a block tree. Pages have revision history with restore. Creating and editing pages needs the Editor role or above.
  • Blocks. Built-in types: hero, richText, image, cta, columns, spacer, reusableBlockRef and rawHtml. A columns block holds child blocks. Nesting is limited to two levels: a block and that block’s non-nesting children.
  • Editor. Add, remove, duplicate, drag to reorder, and undo/redo (in the current editing session). Rich text is sanitized on save and again on every public read.
  • Reusable blocks. A block saved once and referenced from many pages. It is a live reference: editing it updates every page that uses it.
  • Templates. A default block composition copied once into a new page. Editing a template later does not change pages already created from it.
  • Raw HTML block. Off by default. An Admin or Owner enables it in Settings → API. HTML is sanitized on every save and every public read, and switching the flag off hides every raw block immediately.
  • Routes for content types. A content type can declare a routePattern such as /blog/{slug}. Exactly one required {slug} parameter is supported. Pattern collisions with another content type or a page route are rejected. The paths api and admin are reserved.
  • Navigation. Navigation items in Settings can target a URL or a page; a page target resolves to that page’s route.
  • Live Preview for pages, with a separate page preview URL template. See Live Preview.
  • Public API for published pages, reusable blocks and route patterns. See Public API.

A page’s status is draft or published. A draft page is not returned by the public API.

The sidebar has Pages, Templates, Reusable blocks and Global variables under the content section.

  • Pages → New page: enter a Title and a Route (such as /about), and optionally Start from a template (or a blank page). The route is the page’s public address and must be unique. The page editor holds the block tree, status, scheduling, revisions and Live Preview.
  • Templates → New template: a Name, a Scope (a general-purpose page template, or one tied to a content type) and a block composition. Templates only seed new pages. Editing one never changes existing pages.
  • Reusable blocks → New reusable block: a Name, a Block type and that block’s settings. Reusable blocks can be a hero, richText, image, cta or spacer; they cannot be columns, another reference or raw HTML. Add one to a page with a reusableBlockRef block. Editing or deleting one clears the cached pages, since it may be embedded anywhere.

The CMS does not render pages. Your frontend does. @kenresoft-cms/astro provides route resolution and a block-renderer override registry, and examples/astro-site in the CMS repository contains the reference block components. See Rendering pages in Astro.

  • Plugin-contributed block types.
  • Block patterns or presets.
  • A public endpoint that returns a content type’s field definitions. This is deliberately not exposed.
  • Route patterns with more than one parameter, optional segments or wildcards.