Field types

Switch

Field type switch. Yes or no. Data entry from the cataloguer’s side is described under Switch .

Switch Höhepunkt (highlight) in Moliri switched on, between the fields Frühere Inventarnummern (former inventory numbers) and Wahl

Parameters

KeyValuesIf omittedEffect
designslider, innersliderslider shows a slider with the label beside it, inner writes the label inside the switch
onStringjaLabel when switched on
offStringneinLabel when switched off
value_onString1What is stored when the switch is on
value_offString0What is stored when it is off
labelStringemptyText right at the switch, in addition to the field label
font_sizeNumber16Font size of the label in pixels
colorColour#3057d5Colour when switched on
greyColour#E0E0E0Colour when switched off
JSON
{
  "design": "slider",
  "on": "erledigt",
  "off": "offen"
}

Label or stored value

on and off change only what is written at the switch. Changing ja/nein to erledigt/offen (done/open) changes nothing in the data, and no template needs adjusting.

value_on and value_off change what is stored, for example Ausgestellt (on display) instead of 1. That has consequences: filters, templates and analyses that check for 1 will then find nothing. Existing values are not rewritten. In templates, fcheck() copes with both forms.

Import

The Excel import translates unambiguous yes and no entries (including the label from on) into value_on and value_off. Everything else is parked, see Resolve references .

Formatting

The field type comes with Label: it outputs the field’s on or off. See Formatting .

When another field type fits

If you need a third state, such as unknown: a select list with three options. Switching from a switch to a select list later is not straightforward, because 1 and 0 are not option texts. The values then have to be rewritten with a bulk edit .