Using a modal with Structures

Last modified: June 1st, 2023

Sometimes the number of structures you add becomes far too many for a dropdown. A modal with search, tagging and bigger images is available for this situation. For this we set the style key to modal at the same level as our values array.

Configuration
copied
_structures:
  example:
    style: modal
    values:
      - label: First
        value:
          name: 
          description: 
          image: 
      - label: Second
        value:
          heading: 
          subtext: 
Configuration
copied
{
  "_structures": {
    "example": {
      "style": "modal",
      "values": [
        {
          "label": "First",
          "value": {
            "name": null,
            "description": null,
            "image": null
          }
        },
        {
          "label": "Second",
          "value": {
            "heading": null,
            "subtext": null
          }
        }
      ]
    }
  }
}
Configuration
copied
[_structures.example]
style = "modal"

  [[_structures.example.values]]
  label = "First"

    [_structures.example.values.value]

  [[_structures.example.values]]
  label = "Second"

    [_structures.example.values.value]
An array patiently waiting for someone to click the add button
The Structures modal showing the two defined values with minimal configuration.

Related Articles

Open in a new tab