Cockpit CMS reordering Repeater field

1.3k Views Asked by At

I have a repeater of set fields in my Collection in Cockpit CMS.

Options is:

{
  "fields": [
    {
      "type": "set",
      "label": "Some Block",
      "options": {
        "fields": [
          {
            "name": "title",
            "type": "text"
          },
          {
            "name": "picture",
            "type": "image"
          }
        ]
      }
    }
  ]
}

How to use display option in repeater for display title field with re-ordering mode? If it's possible.

The cockpit docs are not sufficiently informative, and it says:

"display": null // display value on re-order

And how to use this option in other cases, except null?

1

There are 1 best solutions below

0
On BEST ANSWER

OK. I found the solution.

Option display can be a part of options of set field:

{
  "fields": [
    {
      "type": "set",
      "label": "Some Block",
      "options": {
        "display": "title", // it must be placed here
        "fields": [
          {
            "name": "title",
            "type": "text"
          },
          {...}
        ]
      }
    }
  ]
}