Labels

Labels

{{ labels }}

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

Name Type Description
is_valid Boolean True if there is at least one key-value pair
value String A comma-delimited lisf 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 The same as&nbps;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 paris which may be iterated using a {% for %} loop. For more details, see the examples below:

{{ label_field }}

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

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

Examples

List all keys and values for a labels field

Copy
    {% for kvp in entity.labels %}
  • {{kvp.Key}} = {{kvp.Value}}
  • {% endfor %}