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

Field yesno

Version: Free.

Why this type

Familiar UX for MODX editors. Boolean in the section data. Compact than radio for simple yes/no.

When to use

  • "Published", "Show on homepage"
  • showWhen with value true or false
  • Legacy schemas that used yesno TVs

Tips

Switch UI use toggle. Multiple labeled options need select, not yesno.

Similar types

Schema

json
{
  "name": "visible",
  "type": "yesno",
  "label": "Show",
  "tab": "Content",
  "width": 100,
  "active": true
}

Value

Boolean.

Section data

Key visible in the section data:

json
{
  "visible": true
}

Chunk example

fenom
{if $visible}<div class="block">…</div>{/if}

Notes

Aliases: boolean, listyesno, list_yes_no.

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