Skip to content

Content Types

Menu: Content → Content Types
Deep link: /_Admin/content/contentTypes?SiteId={siteGuid}
Edit: /_Admin/content/contentType?SiteId=...&id={typeId} (no id when creating)

Content types define the field structure of content entries (similar to a database table schema). Creating a content folder requires specifying a content type.

Prerequisite

You should already be inside the site admin. Before using k.content, read the Content overview.

How to Open

  1. Open Content → Content Types in the left sidebar.
  2. The list page route is /_Admin/content/contentTypes?SiteId=....
Content type list

List Page

Column / actionDescription
NameType identifier; English names such as Article or Product are recommended
FieldsNumber of configured fields
EditOpens the field definition page
NewCreates a new content type
Batch deleteDeletes selected types when dependencies allow (per system prompts)

Edit Page: Type and Field List

  1. Click New (or Edit on the list).
  2. When creating, enter the Content Type Name (cannot be renamed after save).
  3. Maintain fields in the table; click New field or row Edit to open the Field Editor dialog.
  4. Fields can be dragged to reorder; expand System fields in the header (e.g. Id, created time); usually read-only.
  5. Save the whole page to persist type and fields (prompt if leaving with unsaved changes).
Content type: field list and new field

WARNING

Changing control types or deleting fields after go-live can affect existing content. Proceed carefully and back up first.

Field Editor

The dialog title is Field Editor, with Basic, Advanced, and Validation tabs. The bottom Preview area changes with control type.

Basic

Field editor: Basic tab (text box)
SettingDescription
NameField key; should start with English letters; display name can change after create; name is usually locked after saving the type
Summary fieldWhen checked, the field can appear as summary in content lists
Display nameForm label in the admin
Control typeSee “Available control types” below
Default valueMost controls allow a default at the bottom of Basic (Content type excluded)
PreviewRead-only preview below the dialog reflecting control type and default

Available control types:

Control typeTypical use
Text boxSingle-line text
TextareaParagraphs
Rich textBody with images (toolbar configurable in Advanced)
SelectSingle or multi select (depends on Enable multiple)
CheckboxMulti-select list
RadioMutually exclusive options
SwitchBoolean
ImagePick from media library
Advanced imageImage with meta (e.g. alt)
FilePick from Content → Files (CMS file library), not k.file disk paths
Date-timeOptional Fixed timezone and timezone picker
NumberNumeric values
Color pickerColor
Key-valueKey-value pair list
Value listMulti-value list
ContentRelate entries from another content folder (select target folder)

Option-based: Select, Checkbox, Radio

After choosing Select, Checkbox, or Radio, configure option source.

Fixed options — maintain “display name + value” manually:

Field editor: select with fixed options

Dynamic options — check Dynamic options, return key / value arrays from KScript:

Field editor: dynamic options and KScript editor
ModeDescription
Fixed optionsFixed, small enumerations
Dynamic optionsOptions from runtime data (products, content, etc.) via server-side script

Kooboo official example (e-commerce product list → dropdown):

typescript
const products = k.commerce.product.list();
return products.map((it) => {
  return {
    key: it.title,
    value: it.id,
  };
});
  • key: label shown in the UI
  • value: value stored on the content field

Non-commerce scenarios can use k.content.{folder}.all() etc., as long as the return is { key, value }[].

File and image: Enable multiple

When control type is Image, Advanced image, or File, Enable multiple appears on Basic:

  • When checked, the field can store multiple files/images (e.g. gallery, attachments).
  • Only changeable when creating a new field; may be disabled if a default is already set.
  • Toggling Enable multiple clears any default value.

Date-time: Fixed timezone

After checking Fixed timezone and selecting a timezone, the field displays and stores values in that timezone, avoiding inconsistent editor local timezones.

Content type field

When control type is Content, select a content folder (existing folder name in the site) to pick related entries in this field.


Advanced

SettingDescription
Field hintPlaceholder text on the input (tooltip)
User editableWhether end users can change the field on the front end
Enable multilingualStore per language; applies to text box, textarea, rich text, image, key-value, value list, file, etc. (when shown in UI)
Show in search resultsWhether the field appears in content search results
Rich textConfigure TinyMCE toolbar, fonts, sizes (may follow site default rich text settings)
Text boxAuto-generate from field and pick another text box/textarea field as source
Advanced imageMeta key-value table for extra image attributes (e.g. alt); supports placeholders; src etc. are reserved keys

System fields can also set User editable on Basic; custom field advanced options follow the dialog.

Field editor: Advanced tab

Validation

Configure validation on save and validation failure messages (custom error text). Switch controls and system fields usually have no this tab.

Steps:

  1. Pick a rule type in Select validation rule.
  2. Click + to add; multiple rules allowed (generally one per type).
  3. Under each rule, set thresholds/patterns and validation failure message for users (placeholders may appear beside fields, e.g. file type/size templates).

Rules by control type (unlisted types usually only Required):

Control typeAvailable rules (examples)
Text box, textareaRequired, unique, string length, min/max length, regex
NumberRequired, range, min/max value, regex
Checkbox, contentRequired, minimum selected, maximum selected
ImageRequired, max file size, allowed file types (extensions)
OthersMostly Required
RuleParameters
String length / rangeMin and max
Min/max length, min/max selectedSingle number
RegexRegular expression
File sizeNumber + KB/MB
File typeExtension multi-select (e.g. .jpg, .png)

When saving a field, if Basic, Advanced, or Validation fails validation, the dialog switches to the corresponding tab.

Field editor: Validation tab and failure messages

Relationship to Content Folders

  • One content type can be referenced by multiple content folders (when the product allows).
  • When creating a content folder, the Content type dropdown lists existing types; the type usually cannot be changed after the folder is created (per UI disable state).
  • From the content folder list, use Edit content type (pencil icon) to jump here.

Relationship to Development Docs

AdminDevelopment
Type name, field namesProperties on objects from k.content.{folder}.get()
Dynamic options scriptServer-side KScript returning key-value arrays
Multilingual fieldsWorks with site languages and culture
Validation rulesValidated on admin save; API behavior in k.content
Query and filterk.content · k-data
DocDescription
Content foldersBind type and enter entries
Content overviewMenu overview
Media libraryResources for image/file fields
k.contentScript access