Liqiud basics
Modules
API
Mailer
Dynamic Fields
Overview
Order
Order Items
Customers
Below is a list of all the available drops on the Dynamic Fields object
DynamicFieldsDrop
| Name | Description |
| all | Array <DynamicFieldValueDrop> |
| field_name | DynamicFieldValueDrop for the field name |
DynamicFieldValueDrop
| Name | Description |
| name | Name of dynamic field |
| presentation | Localized presentation |
| field_type | Available types: text, textarea, number, measurement, file |
| measurement_unit | Only used in measurement type |
| position | Position of dynamic field |
| customer_field | customer field? (can be used to check if this field name is shared between other models) |
| order_field | order field? |
| order_item_field | order item field? |
| file? | field_type == 'file' ? |
| measurement? | field_type == 'measurement' ? |
| dynamic_field_id | WM3 dynamic field identifier |
| dynamic_field_value_id | WM3 dynamic field value identifier |
| value | Value of the dynamic field |
| has_file? | If the dynamic field contains a file |
| download_url | The URL will redirect for a temporary download url. |
| boolean | If the dynamic field is a boolean |
| timestamp | If the dynamic field is a timestamp |
Liquid example for customer
{% for field in customer.dynamic_fields.all %}
<div class="col-md-4">
<label for="customer_dynamic_fields_{{field.id}}">{{ field.presentation }}</label>
{% if field.file? %}
<input class="form-control" id="customer_dynamic_fields_{{field.id}}" name="customer[dynamic_fields][{{field.name}}][file]" type="file">
{% else %}
<input class="form-control" id="customer_dynamic_fields_{{field.id}}" name="customer[dynamic_fields][{{field.name}}][value]" type="text" value="{{field.value}}">
{% endif %}
</div>
{% endfor %}Don't forget to add enctype="multipart/form-data" to the form if any file fields exist.
To delete a file, send the following param with the value of 'true':
customer[dynamic_fields][{{field.name}}][delete]
Updated: 2021-01-05