Hi forum
I am wondering if this combination of a structured field is possible:
- Disable the option to create new entries for a structure field
- make each entry open in the drawer on click for better readability
- make pagination work
I want to update this structured field programmatically via a hook and from the panel which triggers the same hook.
I achieved the basic with:
my_structured_field:
disabled: false // enable to make pagination and click on entries work
sortable: false
type: structure
limit: 10 // show pagination
max: 1 // disable the 'add' option afte the first entry
fields:
....
Now the user cannot create a new entry when one entry already exists, but can use the pagination and open each entry in the drawer for better readability and browsing through the entries.
Updating the field programmatically via the hook is not a problem.
However, when I am trying to update a field from the panel which triggers the same hook, I get this error:
Invalid form with errors
“my_structured_field: Bitte gib einen Wert ein, der nicht größer als 1 ist”
Now, when I remove the “max: 1” from the blueprint, it works again.
But the user can add entries again.
When I add “disabled: true”, the pagination is gone and the user can not open an entry in the drawer no more.
Is this combination even possible?
Thanks a lot