Skip to content
  1. Extras
  2. PageBuilder
  3. Field types
  4. Free
  5. select

Field select

Version: Free.

Why this type

  • Options live in section JSON, no xPDO query
  • Takes less space than radio for long lists
  • Stored value is the option value, not the label

When to use

  • Size, theme, alignment, or layout preset
  • Five to twenty fixed choices without search
  • Enum-like section settings

Tips

  • Database-driven lists need combo (Pro)
  • Two to four visible choices fit radio better

Similar types

Schema

json
{
  "name": "size",
  "type": "select",
  "label": "Size",
  "options": [
    {
      "label": "S",
      "value": "sm"
    },
    {
      "label": "L",
      "value": "lg"
    }
  ],
  "tab": "Content",
  "width": 100,
  "active": true
}

Value

String: selected option value.

Section data

Key size in the section data: the selected option value string:

json
{
  "size": "lg"
}

Chunk example

fenom
{switch $size}
  {case 'sm'}<div class="block block--sm">{/case}
  {case 'lg'}<div class="block block--lg">{/case}
  {default}<div class="block">{/default}
{/switch}

Notes

Dynamic list: optionsSource → processor mgr/field/options.

Common properties

For fields with name that are stored in the section data:

KeyTypeRoleCMP
tabstringGroup subtitle in the inspectoryes
width25–100Field width as % of the row (flex)yes
descriptionstringHint under the labelyes
defaultanyInitial value for a new sectionyes
activeboolfalse hides the field in the inspectoryes
requiredboolRequired on publish (draft still saves)yes
  • Also: options or optionsSource.

See fields overview.

See also