Skip to content

Pages & Content Types

Pages are the primary content entity in WollyCMS. Every page belongs to a content type that defines its schema — which fields it has and which regions are available for blocks.

A content type is a blueprint for a category of pages. It defines:

  • Fields schema — structured data fields attached directly to the page (subtitle, featured image ID, author, etc.)
  • Regions — named areas where blocks can be placed (hero, content, sidebar, footer)
  • Allowed block types per region — optionally restrict which block types editors can add to each region

Use the admin API to create content types programmatically:

Terminal window
curl -X POST http://localhost:4321/api/admin/content-types \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Blog Post",
"slug": "blog_post",
"description": "A blog article with hero and content regions",
"fieldsSchema": [
{ "name": "subtitle", "label": "Subtitle", "type": "text" },
{ "name": "featured_image", "label": "Featured Image", "type": "media" },
{ "name": "author", "label": "Author", "type": "text", "required": true }
],
"regions": [
{ "name": "hero", "label": "Hero", "allowed_types": ["hero", "image"] },
{ "name": "content", "label": "Content", "allowed_types": null }
]
}'

Setting allowed_types to null means any block type can be placed in that region.

Content TypeSlugTypical Regions
Marketing Pagemarketing_pagehero, content, cta
Blog Postblog_posthero, content, sidebar
Landing Pagelanding_pagehero, features, testimonials, cta
Documentationdoc_pagecontent

A page is an instance of a content type. It has:

  • title and slug (URL path)
  • statusdraft, published, or archived
  • fields — key/value data matching the content type’s field schema
  • regions — blocks organized by region name
  • SEO metadata — meta title, description, OG image, canonical URL, robots
  • Taxonomy terms — categorization via vocabularies
Terminal window
curl -X POST http://localhost:4321/api/admin/pages \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Getting Started with WollyCMS",
"slug": "blog/getting-started",
"typeId": 2,
"status": "draft",
"fields": {
"subtitle": "A quick tour of the CMS",
"author": "Jane Developer"
}
}'

If you omit slug, WollyCMS auto-generates one from the title.

StatusVisible on content APIEditable
draftNoYes
publishedYesYes
archivedNoYes
import { createClient } from '@wollycms/astro';
const wolly = createClient({ apiUrl: 'http://localhost:4321/api/content' });
// Get a single page by slug
const page = await wolly.pages.getBySlug('blog/getting-started');
// List published pages, filtered by content type
const posts = await wolly.pages.list({
type: 'blog_post',
sort: 'published_at:desc',
limit: 10,
});
ParameterTypeDescription
typestringFilter by content type slug
taxonomystringFilter by taxonomy (category:news or just category)
sortstringSort field and direction (published_at:desc, title:asc)
limitnumberResults per page (max 50)
offsetnumberPagination offset

Content type fields and block type fields use the same schema format:

TypeDescription
textSingle-line text
textareaMulti-line text
richtextTipTap rich text editor (JSON output)
numberNumeric value
booleanTrue/false toggle
selectDropdown with predefined options
mediaMedia picker (stores media ID)
urlURL input
colorColor picker
groupNested group of fields

Each field definition supports required, default, min, max, and options (for select fields).