Repository navigation
Content Types
A content type is a kind of content of a site: a page, a blog post, a product, a team member. It has fields, and every entry of the type fills them. Administrators of a site define its content types; editors and AI programs write entries of them.
Each content type has a key (lowercase letters, digits and underscores, e.g. blog_post) that never changes, a name, a description and its fields. AI programs get a tool per content type named after the key, so renaming the type never breaks them.
Open a site in the rail and choose Fields and types (administrators). There you add a content type, give it a name and a description, and add its fields one by one: the kind is chosen in plain words (short text, formatted text, number, yes/no, date, choice, link to another entry, image or file, list of words, blocks), and only the options that fit the kind are offered. Fields are moved up and down; block types and their fields are edited below. Every content type then has a row of its own in the site's column, where its entries are.
Every field has a key, a label people see, a kind, and these options:
| Option | Meaning |
|---|---|
required |
needs a value before the entry is published; drafts may leave it empty |
translatable |
one value per language of the site; otherwise one value for all languages |
help |
a sentence that explains the field, shown to people and AI programs |
| Kind | Holds | Options |
|---|---|---|
text |
a short text |
min_length, max_length (default 10 000), multiline
|
markdown |
formatted running text, written as Markdown |
min_length, max_length
|
number |
a number |
min, max, integer
|
boolean |
yes or no | |
date |
a date (2026-12-04), with with_time a date and time |
with_time |
choice |
one of fixed values |
choices (value and label), multiple
|
reference |
another entry |
types (the content types it may point to), multiple
|
medium |
an image or file | multiple |
list |
a list of short texts, such as tags |
min_items, max_items, max_length per item |
blocks |
a list of blocks, such as a hero, a call to action, a gallery |
allowed_blocks, min_items, max_items
|
multiple lists take min_items and max_items too.
Block types are defined with the content type: each has a key, a label and its own fields. A blocks field names the block types it allows. Fields inside a block are not translatable on their own; make the blocks field translatable to have a different list of blocks per language. Blocks do not hold blocks.
{
"fields": [
{"key": "title", "kind": "text", "required": true, "translatable": true, "max_length": 120},
{"key": "body", "label": "Text", "kind": "markdown", "translatable": true},
{"key": "category", "kind": "choice", "choices": [{"value": "news", "label": "News"}, {"value": "howto", "label": "How-to"}]},
{"key": "author", "kind": "reference", "types": ["person"]},
{"key": "sections", "kind": "blocks", "allowed_blocks": ["hero", "cta"], "translatable": true}
],
"blocks": [
{"key": "hero", "fields": [{"key": "heading", "kind": "text", "required": true}, {"key": "image", "kind": "medium"}]},
{"key": "cta", "label": "Call to action", "fields": [{"key": "label", "kind": "text"}, {"key": "url", "kind": "text"}]}
]
}A misspelt option is refused, not ignored. Keys such as id, slug, status or language are used by OwnCMS itself and cannot be field keys.
An entry holds one value per field. A translatable field holds one value per language: {"title": {"de": "Hallo", "en": "Hello"}, "category": "news"}. A blocks field holds [{"type": "hero", "fields": {"heading": "Welcome"}}]. The exact shape of a content type's entries is given as a JSON Schema by the AI tool describe_content_type.
Two people changing the same content type at once cannot overwrite each other: the second change is refused. A change of fields that would remove values of existing entries says how many and which, and needs a confirmation (see Entries). A content type another one refers to cannot be deleted until that reference is gone; deleting it deletes its entries and asks to repeat the name.
OwnCMS: https://github.com/ownlabs-dev/owncms. This wiki is generated from the wiki/ folder in the repository; edit the files there, not in the wiki.
OwnCMS
Using it
- Getting Started
- Sites
- Content types
- Entries
- Media
- Reading content
- People
- Two-factor sign-in
- AI programs
Running it
Background