{{ fieldset }}

fieldset Summary

A group of fields which together define a custom object. May either define a single object or a list of objects.

fieldset Properties

Field containing either a single custom object or multiple custom objects - depending on whether allow_multiple is true.

Field Type Description
object_type string Will always be "fieldset".
is_valid boolean True if there is at least one custom object
objects list A list of custom data objects defined by this fieldset. Only if allow_multiple is true.
fields varies A single custom data object defined by this fieldset. Only if allow_multiple is false.
value string The same as what you would see when inspecting this object. For fieldset fields you do not typically care about this - use objects or fields instead.
output string Same as value.
output_in_list string Same as value.
field_id string The identifier for this field.

You may also treat this object as a list containing all of the child objects (if allow_multiple is true) or fields (if allow_multiple is false) which may be iterated using a {% for %} loop. For more details see the examples below:

If allow_multiple is false, individual fields may be accessed using the {{ object.keyName }}, {{ object['keyName'] }}, {{ object.fields.keyName }}, or object.fields['keyName'] syntax.

You may also treat this object as a list containing all of the fields which may be iterated using a {% for %} loop. For more details, see the examples below:

Examples

List all values in a fieldset field

Copy
{% if entity.fieldset.is_valid %} {% unless entity.fieldset.allow_multiple %}
    {% for field in entity.fieldset %} --equivalent to {% for field in entity.fieldset.fields %}
  • {{field.field_id}} = {{field.output}}
  • {% endfor %}
{% endunless %} {% endif %}

Working with specific fieldset properties

Copy
{% if entity.fieldset.is_valid %} {% unless entity.fieldset.allow_multiple %} {% if entity.fieldset.field1.is_valid %}

Field 1 Value: {{entity.fieldset.field1}}

{% endif %} {% if entity.fieldset['field2'] %}

Field 2 Value: {{entity.fieldset['field2']}}

{% endif %} {% if entity.fieldset.fields.field3.is_valid %}

Field 3 Value: {{entity.fieldset.fields.field3}}

{% endif %} {% if entity.fieldset.fields['field4'] %}

Field 4 Value: {{entity.fieldset.fields['field4']}}

{% endif %} {% endunless %} {% endif %}

List all objects in a fieldset field

Copy
{% if entity.fieldset.is_valid and entity.fieldset.allow_multiple %}
    {% for object in entity.fieldset %} --equivalent to {% for object in entity.fieldset.objects %}
  • {{ object.custom_title }}{% if object.custom_description.is_valid %}
    {{ object.custom_description }}{% endif %}
  • {% endfor %}
{% endif %}