Skip to content
  1. Extras
  2. PageBuilder
  3. Field types
  4. Pro
  5. keyvalue

Field keyvalue

Version: Pro.

Why this type

Simpler than table for single text value column. KeyLabel and valueLabel customize captions. Free row count without column schema.

When to use

  • Meta attributes, params, simple specs
  • Custom props for chunk
  • Name/value list without cell types

Tips

Typed cells or image in cell need table. Single flat map sometimes beats repeater of two text fields.

Similar types

Schema

json
{
  "name": "meta",
  "type": "keyvalue",
  "label": "Meta",
  "keyLabel": "Parameter",
  "valueLabel": "Value",
  "tab": "Content",
  "width": 100,
  "active": true
}

Value

Array of { key, value }.

Section data

Key meta in the section data: array of pairs:

json
{
  "meta": [
    {
      "key": "author",
      "value": "PageBuilder"
    },
    {
      "key": "version",
      "value": "1.0"
    }
  ]
}

Chunk example

fenom
{foreach $meta as $row}
  <div><strong>{$row.key|escape}:</strong> {$row.value|escape}</div>
{/foreach}

Notes

Column labels: keyLabel, valueLabel (or key_label / value_label).

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: keyLabel, valueLabel (or key_label / value_label).

See fields overview.

See also