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

Field yesno ​

Version: Free.

Why this type ​

The yes/no control MODX editors already know. The section stores a yes or no value. For a simple yes or no it takes less space than radio.

When to use ​

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

Tips ​

Toggle: toggle. Several options from a list: 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 ​

modx
<div class="block">…</div>
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 ​