Select options then work in Structure data within the panel. - Example

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.

How to query from this

  bestband:
   label: Best Band Ever
   type: multiselect
   required: true
   search: true
   options:
     1d : 1Direction
     bb: BBoys
     aq: Aqua
     vb: Vengaboys
     fr: Freiheit
     o3: OH!O
     mi: Miley
     bi: Bieber
     u2: U2

and call it into a structured data table as a field with a text box?

Just to get this right.

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

Is that correct?

Yes :slight_smile: correct thank you :slight_smile:

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’m actually using that now.

Well, yes, but this field can be left untouched, I think, it just serves as the field you query in your structure field.

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.

You are suggesting hiding it with their format. But using a toggle in javascript within the app. Will that work inside structued data?

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?

It will be used to kick out a datatable. https://datatables.net/

Several different pages have different field values. Thanks for your fast replies. :slight_smile:

I’ll try this all again tomorrow. Right now I’m stuck.

What about this field: https://github.com/jenstornell/kirby-plugins/issues/492