{{ trigger.call("before_post_fields", feather) }} {% for field in feather.fields %} {% if attribute(post, field.attr) is defined %} {% set field_value = attribute(post, field.attr) %} {% else %} {% set field_value = field.value is defined ? field.value : "" %} {% endif %} {% set field_count = field_value is iterable ? field_value | length : 1 %} {% set field_preview = field.preview is defined and field.preview ? " data-preview" : "" %} {% set field_multiple = field.multiple is defined and field.multiple ? " multiple" : "" %} {% set field_accept = field.accept is defined ? ' accept="' ~ (field.accept | fix(true)) ~ '"' : "" %} {% if site.enable_markdown %} {% set field_markdown = field.filters is defined and (field.filters | contains("markup_text")) ? " data-markdown" : "" %} {% else %} {% set field_markdown = "" %} {% endif %} {% if post is not defined %} {% set field_required = field.optional is defined and field.optional ? "" : " required" %} {% else %} {% set field_required = field.type == "file" or field.optional is defined and field.optional ? "" : " required" %} {% endif %} {% set field_id = (field.attr ~ "_field") | fix(true) %} {% set field_name = (field_multiple is not empty ? field.attr ~ "[]" : field.attr) | fix(true) %}
{% endfor %} {{ trigger.call("after_post_fields", feather) }}