Fieldtypes

In Cockpit you can build custom content models defined by a collection of different field types.

Asset


An asset field can reference an asset (e.g. file or pdf) you've uploaded in Cockpits Asset-Manager.

Boolean


A boolean field for true and false values.

Options

{
    "label": false
}

Code


Provides a code editor field.

Options

{
    "syntax": "text"
}

Collection-Link


Link other collection items.

Options

{
    "link": "collectionname",
    "multiple": false,
    "display": "fieldname",
    "limit": false
}

Color


Provides a color chooser field (based on Spectrum.js).

Options

{
    "spectrum": {/* spectrum settings */}
}

Date


Provides a date chooser field (based on Spectrum.js).

Options

{
    "weekstart": 0,
    "format": "YYYY-MM-DD"
}

File


Provides a file chooser field (using Cockpits built-in finder module).

Gallery


Manage images and additional meta information for each image.

Options

{
    "meta": {
        "title": {
            "type": "text",
            "label": "Title"
        }
    }
}

Html


Html editor field with preview.

Image


Choose an image and manage additional meta information.

Options

{
    "meta": {
        "title": {
            "type": "text",
            "label": "Title"
        }
    }
}

Location


Location chooser to get lat,lng values.

Markdown


Markdown editor field with preview.

Multipleselect


Select multiple values from a pre-defined list of options.

Options

{
    "options": "Option 1, Option 2, Option 3"
}

Object


JSON object editor.

Password


Password field.

Rating


Rating field.

Options

{
    "mininmum": 0,
    "maximum": 5
}

Repeater


Manage multiple values of fields.

Options

{
    "field": {"type": "text", "label": "Name"}
}

or add field chooser

{
    "fields": [
        {"type": "text", "label": "Name"},
        {"type": "html", "label": "Html Code"}
    ]
}

Select


Provides a selectbox.

Options

{
    "options": "Option 1, Option 2, Option 3"
}

Set


Provides a field group.

Options

{
    "fields": [
        {"name":"name", "type": "text"},
        {"name":"about", "type": "html"}
    ]
}

Tags


Manage a list of tags.

Options

{
    "autocomplete": []
}

Text


Simple text input.

Options

{
  "slug": true
}

Textarea


Simple textarea field.

Time


Time picker field.

WYSIWYG


A WYSIWYG editor field.