Am I missing some documentation?

I’m new to Cockpit and it works and seems mostly straightforward but there’s stuff I just can’t find in the docs.

I’m looking at Documentation

Examples…

  • when editing Collections what does the 1-1, 1-2, 1-3 (etc) selection do next to each field?
  • how do you actually use many of the field types? For instance ‘CollectionLink’. I want a way to add a link between pages which will be in different collections (I think). Is this what I need? There’s no description.

Sorry - this seems a bit negative but I’m really struggling to find information.

Hiya here’s some brief info:

The numbers represent the width of the block which will either be based on grid or flex-box in the admin panel. So if you have 4 fields with 1-4, when you come to add or edit an entry, the 4 fields will be in a row, as apposed to one field per row as default.

The ‘CollectionLink’ is a way to respectively link one collection to another. In order to use it you need to add some options to it:

In the docs:

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

Obviously replace the defaults above for some of your own data, for example if you have a collection called ‘cars’ that contains a list of 5 cars including their name, colour & age, and you want to link an entry to the whole list it would be:

{
    "link": "cars",
    "display": "name",
    "multiple": true,
    "limit": false
}

Then when you go to edit the field, you will be prompted to select all the entries inside the ‘cars’ collection you wish to be related to your new/current collection. The display property is just a shorthand field to differentiate each item on the admin panel. When you fecth the data over your API, you can use:

{"populate":1}

To pull in the rest of the fields for the linked ‘CollectionLink’ items. If you don’t use populate, your API will only return the display field which would be ‘name’ in the above example.

Hope this is helpful!

2 Likes

Ahh… that’s great. I’m starting to get the “thinking”. It’s actually turning out to be really easy to use.