Beta . Ortha CMS is in public beta. Every plan is free until it ends.
Features Ortha CMS on GitHub

Field type reference

Content plugin @orthacms/content-server@orthacms/content-admin

Every builder, its options, its column, its API types, and whether it can be filtered or sorted.

Documents 0.13.1 Updated Edit this page Report a problem

On this page

The lookup tables. The narrative is on fields.

import { field } from '@orthacms/content-server/define';

Builders and options

BuilderOwn options
field.textminLength, maxLength, pattern
field.richtextminLength, maxLength, structure: 'on' | 'off'
field.numbermin, max, integer
field.moneymin, max (minor units)
field.boolean—
field.date—
field.datetime—
field.selectoptions (required)
field.multiselectoptions (required)
field.json—
field.mediamultiple, accept: { kinds?, mimeTypes? }
field.relationto (required), many, onDelete, unique, syncAcrossLocales
field.relationInverseof (required), field (required), many

Every builder also takes:

OptionNotes
requiredNOT NULL on a non-publishable type; a publish-time rule on a publishable one
localizedOnly on i18n types (boot error otherwise). On a relation, equals syncAcrossLocales: false
langWell-formed BCP-47, checked at boot
adminlabel, description, placeholder, widget, hidden, group, row, width: 'half' | 'full', plus your own keys

Storage and API types

BuilderPostgresREST valuesGraphQL
texttextstringString
richtextjsonbdocument object (or legacy string)JSON
numberdouble precision; integer with integer: truenumberFloat; Int with integer: true
moneyinteger (minor units)integerFloat
booleanboolean (DEFAULT false when required)booleanBoolean
datedate"YYYY-MM-DD"Date
datetimetimestamptzISO-8601 stringDateTime
selecttextstringenum <Type><Field> (String if an option is not a valid name)
multiselectjsonb arraystring[][<Type><Field>!]
jsonjsonbanyJSON
mediauuid; jsonb array with multiple — no FKomitted — ?media=preview[MediaAsset!]!
relation<field>_id uuid FK; join table with many; nothing when inverseomitted — ?relations=previewtarget type; <Type><Field>Links { items total } when many/inverse

A relation or media field pointing at a type the workspace cannot reach is omitted from the GraphQL schema.

Filterable and sortable

Builder?filter=?sort=?search=
text✅✅✅
richtext——✅
number, money✅✅—
boolean✅✅—
date, datetime✅✅—
select✅✅✅
multiselect———
json———
media———
relationVia a dotted path (admin)——

Plus the envelope: id, createdAt, updatedAt, publishedAt, and on localized types locale and localeGroupId. status is filterable on the admin API only. Sorting defaults to -updatedAt.

curl -G https://cms.example.com/api/v1/content/article \
  -H 'Authorization: Bearer orthacms_…' \
  --data-urlencode 'filter={"and":[{"field":"featured","op":"eq","value":true}]}' \
  --data-urlencode 'sort=-publishedAt'

Locale behaviour

DeclarationOn an i18n type
UnmarkedShared — one value, written to every sibling
localized: truePer locale
relation, sync on, non-i18n targetShared — the same target id everywhere
relation, sync on, i18n targetMirrored — resolved to each sibling’s locale
relation, syncAcrossLocales: falseIndependent per locale
relationInverseNever propagates

Envelope columns

ColumnAPI fieldTypePresent when
ididuuidAlways
workspace_id—uuidAlways. No FK
created_atcreatedAttimestamptzAlways
updated_atupdatedAttimestamptzAlways
statusstatustextpublishable
published_atpublishedAttimestamptzpublishable
deleted_at—timestamptzparanoid
localelocaletexti18n
locale_group_idlocaleGroupIduuidi18n

All nine column names are reserved on every type, flag or not. In GraphQL translations is reserved too.

Validation

BuilderChecked for
textLength in grapheme clusters, pattern
richtextText length, structural rules (unless structure: 'off')
numberRange, whole number with integer
moneyRange, whole number (minor units)
dateShape and a real calendar date
datetimeISO-8601 with a time
select / multiselectMembership of options
relationA uuid; a target visible from this workspace (own, or published in a shared source); same locale when localized
mediaAsset exists in this workspace; accept; alt ≤ 1,000 characters; not decorative and described; on a required field, alt or decorative before publishing

Exact messages: validation.