Skip to main content

select

Schema

{
"layout": {
"type": "select",
"label": "Layout",
"options": [
{ "label": "Grid", "value": "grid" },
{ "label": "List", "value": "list" }
],
"default": "grid"
}
}

Example widget data (after saving settings)

{
"layout": "grid"
}

The data you'll access inside your template:
widget.data.layout
In the example below, this data is used.

Nunjucks example

<p>Layout: {{ widget.data.layout }}</p>

Example output

<p>Layout: grid</p>

This is how it looks in the builder.