Toggle

Toggle

{{ toggle }}

Name Type Description
is_valid Boolean Always true
value String on_value or off_value
default_value String The default value for this field if no value is specified
on Boolean 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)
field_id String The identifier for this field
label String The label for this field
output String on_label or off_label. May include additional markup in the editor preview to make it easier to edit content

Represents an on/off toggle control

Examples

Check if Toggle field is on

Copy
<p>Show subscriptions? <strong>{{ entity.show_subscription_form }}</strong></p>
{% if entity.show_subscription_form.on %}
{% include "Subscription Form" %}
{% endif %}