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

Field tag ​

Version: Free.

Why this type ​

The editor types the labels. There is no fixed options list. It fits filters and labels on cards.

When to use ​

  • Article hashtags, tech stack badges
  • Filter facets on landing
  • SEO keywords in section block

Tips ​

Fixed enum fits multiselect or checkboxgroup. Values are strings, not objects.

Similar types ​

Schema ​

json
{
  "name": "labels",
  "type": "tag",
  "label": "Labels",
  "tab": "Content",
  "width": 100,
  "active": true
}

Value ​

Array of strings.

Section data ​

Key labels in the section data: array of strings:

json
{
  "labels": [
    "new",
    "sale"
  ]
}

Chunk example ​

modx
{foreach $labels as $label}
  <span class="label">{$label}</span>
{/foreach}
fenom
{foreach $labels as $label}
  <span class="label">{$label|pb_text}</span>
{/foreach}

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

See fields overview.

See also ​