Labels

Labels

{{ labels }}

Field containing a list of key-value pairs where the keys are not necessarily unique

Properties of {{ labels }} objects
Name Type Description
is_valid Boolean True if there is at least one key-value pair
value String A comma-delimited list of all of the key-value pairs in this field using the form "key1:value1,key2:value2,etc..." For labels fields you do not typically care about this - use values instead
keys list A list containing all of the unique keys in this field
values object An object containing all of the keys and values of this field. Each object has a Key property and a Value property
count Integer The number of key-value pairs in the dictionary
field_id String The identifier for this field
label String The label for this field
output String Same as value. May include additional markup in the editor preview to make it easier to edit content

Field containing a list of key-value pairs where the keys are not necessarily unique. You may also treat this object as a list containing all of the key-value pairs which may be iterated using a {% for %} loop. For more details, see the examples below:

Related

object

May be any object, including simple, complex and list objects. In some cases may even include symbols and null.

{{ dictionary }}

Object containing a list of key-value pairs where the keys are unique.

number

Can be any number, including integers, decimals, or the value 0. Any value - including 0 - evaluates as true when used alone in a conditional.

integer

A whole (non-fractional, non-decimal) number. May be 0. Any value - including 0 - evaluates as true when used alone in a conditional.

list

An enumerable list containing zero or more objects. Lists may contain many different object types, although most lists only contain a single object type. There are a large number of other complex object types that are also lists (ag: an articlelist is a complex object but is also a list of article objects).

{{ label_field }}

Should be used to display a text label inside a form.

Properties of {{ label_field }} objects
Name Type Description
is_valid Boolean Will always be true
type String Will always be "label"
element_id String A helper property containing a unique ID for this label on this instance of this form. This value should be different every time the form is output
subtext text Help or hint text to display together with the label. Not typically used for label fields, although the developer may specify an alternate use for this or may customize the output using this
condition condition The condition that should be used to show and hide this label
classname String CSS class name(s) to be applied to the label
field_id String The identifier for this field
label String The label for this field
output String Default HTML markup for this label, which makes a number of assumptions about other elements on the page that may or may not be included. Developers should avoid using the default output in order to guarantee that forms work as expected, including styling, conditionals, and more. May include additional markup in the editor preview to make it easier to edit content

How the label is displayed in the form is entirely up to the template developer as there is currently no way for editors to specify the styling to use when displaying labels

Related

{{ form_field }}

{{ form }}

{{ submit_field }}

Should be used to display a submit button inside a form.

{{ checkboxlist_field }}

Should be used to display a list of checkboxes inside a form.

{{ textarea_field }}

Should be used to display a textarea field inside a form.

{{ text }}

{{ hidden_field }}

Should be used to output a hidden field inside a form, which by definition is not displayed to or directly editable by users.

string

Can be any text, from the empty string ("") to the full HTML output of the template. When used alone in a conditional, all strings evaluates as true - even if they are empty or a value such as "0" or "false".

{{ date_field }}

Should be used to display a date field inside a form.

{{ select_field }}

Should be used to display a select list inside a form.

{{ button_field }}

Should be used to display a custom button inside a form.

{{ captcha_field }}

Should be used to display a captcha inside a form.

{{ condition }}

Represents the condition that should be used to show and hide form fields.

{{ file_field }}

Should be used to display a file upload field inside a form.

{{ time }}

Represents a specific instant in a specific timezone.

{{ radio_field }}

Should be used to display a radio field inside a form.

{{ text_field }}

Should be used to display a text field inside a form.

{{ group_field }}

Should be used to display a group of fields inside a form.

{{ labels }}

Field containing a list of key-value pairs where the keys are not necessarily unique

{{ checkbox_field }}

Should be used to display a checkbox field inside a form.

Examples

Demonstrates how to list all keys and values for a labels field.

List all keys and values for a labels field

Copy
<ul>
{% for kvp in entity.labels %}
<li><strong>{{kvp.Key}}</strong> = {{kvp.Value}}</li>
{% endfor %}
</ul>