{{ toggle }}

toggle Properties

Represents an on/off toggle control

Field Type Description
object_type string Will always be "toggle".
is_valid True|False Always true.
value string on_value or off_value.
output html on_label or off_label.
output_in_list html Same as output.
field_id string The identifier for this field.
default_value string The default value for this field if no value is specified.
on true/false True if the toggle is "on". False if it is "off"
on_label string The text to be displayed when the toggle is "on"
on_value string The value represented by the "on" position
on_color string The color of the toggle when it is "on" (could be any valid CSS color)
off_label string The text to be displayed when the toggle is "off"
off_value string The value represented by the "off" position
off_color string The color of the toggle when it is "off" (could be any valid CSS color)

Examples

Check if Toggle field is on

Copy

Show subscriptions? {{ entity.show_subscription_form }}

{% if entity.show_subscription_form.on %} {% include "Subscription Form" %} {% endif %}