Cockpit

Docs

(Un)official Docs

Extending Cockpit

API

Custom Endpoints

MySQL

Field Types

Conditional Fields

... don't exist, but there is an experimental setting: https://discourse.getcockpit.com/t/conditionally-show-field-based-on-another-field/859/4

in the field options you can define a @visibility property, e.g:

"@visibility": "$.external_link === true"

This feature is experimental, that’s why it isn’t documented anywhere. But feel free to try it out.

Repeater Field

💡 add options field for type set https://discourse.getcockpit.com/t/fieldtype-set-in-repeater-field/362/2

{
  "fields": [
    {
      "type": "set",
      "label": "Set",
      "options": {
        "fields": [
          {
            "label": "Druck",
            "name": "druck",
            "type": "text"
          },
          {
            "label": "Temperatur",
            "name": "temperature",
            "type": "text"
          }
        ]
      }
    },
    {
      "type": "html",
      "label": "Html Code"
    }
  ]
}

Set

Provides a field group.
Key Value Store

{
  "fields": [
  {
      "name": "Pressure",
      "type": "text"
  },
  {
      "name": "Temperature",
      "type": "text"
  }
  ]
}

Layout

Gutenberg-like Block Editor

https://discourse.getcockpit.com/t/layout-field-type/303

Create Layout Components with https://github.com/agentejo/LayoutComponents

image-20200624201849537

Add Column

image-20200624200612131

Key-Value (Custom Tag)

image-20200624223448623

https://github.com/raffaelj/cockpit-scripts/blob/master/custom-fields/field-key-value-pair.md

{
    "prefix": "og:",                         // (string), default: ""
    "format": "array",                       // (string) "array|object", default: "object"
    "limit": 5,                              // (int),    default: 0 (unlimited)
    "sortable": true,                        // (bool),   default: false
    "safeDelete": true,                      // (bool),   default: false
    "defaultKeys" : ['title', 'description'], // (array),  default: []
    "displayPrefix" : "og:"                  // (string), default: ""
}

💡 Based on this tag it should be possible to create a version of Wordpress custom fields.

I need something with typeahead and pre-populated fragments based on a collection.

See also: https://github.com/agentejo/cockpit/issues/1308

image-20200624231324829

https://github.com/agentejo/cockpit/blob/100ef091055e6d22c0431092248401486e1b532c/modules/Collections/assets/field-collectionlinkselect.tag