Checkbox
Checkbox fields store an on/off value. This page covers the options available when editing a checkbox field in the Field Editor.
Basic options
Section titled “Basic options”- Field label
The text displayed beside the field when editing a record.
- Database Field
The name the database and program use to refer to the field. In viewers you reference it as:
<?php echo $record['fieldname'] ?>If you rename an existing field, update any references to it in your viewers and Database Editor settings. Some field names have special built-in behavior. See Special Fieldnames.
- Field type
The type of input the field accepts. Each field type has different options. Note that the separator field type doesn’t require a field label or field name.
- Help tooltip
Displays a help icon after the field label; hovering over it shows this message as a tooltip.
Visibility
Section titled “Visibility”- Show for
Limits who can see and edit the field: Everyone, Editors and admins, Admins only, or Nobody. Users without access don’t see the field when creating, modifying, or viewing records (new records save the default value), and the field isn’t shown as a list column.
- Show if
Shows or hides the field on the record edit page based on another field’s value. Pick a field, an operator, and a value. Operators are equals, does not equal, contains, starts with, and ends with (is checked / is not checked for checkbox fields). Use
|between values to match any of several (e.g.draft|pending); for multi-value fields, any matching value counts.Select Custom expression for AND conditions and multi-field rules, using
=,!=,*=(contains),^=(starts with), and$=(ends with) as operators, e.g.type=article AND status!=draft|pending. AND binds tighter than OR,field=matches empty or unchecked, andfield!=matches any value.
Field options
Section titled “Field options”Options specific to the field type appear in this section. For most fields the defaults will be sufficient, but for list fields you will need to set the values for your list options.
- Default state
Whether the checkbox is checked or unchecked when creating a new record.
- Existing records
Shown only when adding a new field. Check “Update all existing records with the default value above” to apply the default state to existing records; otherwise existing records are unchecked.
- Field prefix
Text displayed before or above the field.
- Field description
Text displayed after the checkbox.
- Checkbox labels
The labels displayed for the checked and unchecked states, defaulting to
YesandNo. These are display labels only. The database always stores1for checked and0for unchecked.
Advanced options
Section titled “Advanced options”- System field
System fields cannot be edited and have no modify or erase link unless “System Field Editing” is enabled (under Advanced Commands on the field list page). This prevents accidental changes to fields the program relies on.
- MySQL indexing
Creates a MySQL column index for the field, which speeds up sorting and some searches but slows down adding and saving records.
In viewers
Section titled “In viewers”The field holds 1 for checked and 0 for unchecked, so it works directly
in conditions:
<?php if ($record['featured']): ?> <?php echo $record['featured:text'] ?><?php endif ?>Pseudo-fields
Section titled “Pseudo-fields”-
fieldname:text The checked or unchecked text defined in the field editor.
Pseudo-fields can be turned off with the loadPseudoFields viewer option.
See the Pseudo-field Reference.