I've created an entity which has fields that users need to fill out. As part of that entity there is a reference field back to a content type 'food'.
The 'food' content type has it's own entity reference called 'sections'.
When a user selects a 'food', i want to dynamically add each 'section' as a title with a textarea box underneath which gets stored against the original entity.
Considered using paragraphs as the 'sections' but they need to be reusable on different 'food' nodes. Also checked the dynamic fields module but this doesn't look like it's well supported.
Fallback approach is going to be to programmatically create a field for each 'section' item as they are added, but with this we could end up with hundreds of fields.
Any ideas on how else this can be done programmatically?