So I have something like this below. What I want is to be able to hit the plus button. Get another drop down in the panel. So I ccould add 100 of these if I wanted. Then in my Structured data. It would generate the fields for the structured data based on the results saved from here? Anybody know how to do this.
Thanks
category:
label: Category
type: select
options:
design: Design
architecture: Architecture
photography: Photography
3d: 3D
web: Web
/// Change this. I will use a multiselect plugin. Then I just need to know how to call the selected ones and generate a field in structured data based on those selected.
Supposed someone selects three categories from the above, design, web and 3d. Then you want to generate a structure field with 3 fields, similar to this static one, but the fields would be dynamic depending on the multi-select.
structure:
label: Structure
type: structure
fields:
design:
label: Design
type: text
3d:
label: 3d
type: text
web:
label: Web
type: text
Maybe the toggle field can serve as a starting point for handling fields depending on values of another field? But I think in this case, you have to do it sort of the other way round. That is, start with the structure field. The structure field should have an field option, so it knows which field to query.
I would be able to add 20 fields if I wanted to. The reason for this. 1 template allows multiple pages with multiple field options.
For instance I can have one page with 5 fields, and the other page 10, another 15 and so on. Then in the structured data. I can add multiple rows with the required text fields.
No, I’m not suggesting to use the toggle field. I just wanted to point you to an example field that might give you some ideas how to create your own field.
I can’t offer you a ready to use solution.
But I’m not so sure a structure field is the ideal solution for your task, might get pretty messy. Wouldn’t modules work better?