I’m trying to find a field that returns a structure similar to the image below:
Any suggestion?
artur
March 9, 2023, 5:31pm
2
Use the field type Set and check the “Allow multiple values” checkbox. In the field options add two text fields (question, answer).
Add ${data.question} to the display option to have a preview in the list later.
your modal to edit a field has different information than mine:
You use cockpit v1 and @artur talks about cockpit v2. I think, the best fit would be a set, nested in a repeater. But the core repeater produces different data schemas in some circumstances (can’t remember correctly).
I wrote a custom field a while ago to fix that behavior:
# Simple Repeater
Custom field for [Cockpit CMS](https://github.com/agentejo/cockpit)
A simpler repeater field, than the original one. I modified the code of the original component, so credits go to @aheinze.
Copy the file `field-simple-repeater.tag` to `config/tags`
## difference to original repeater field
short answer: lesser features, cleaner output
**long answer:**
The original repeater field saved the field options in the data, too.
output of original repeater:
```json
"repeaterfield": [
This file has been truncated. show original