blueprints.html.twig 770 B

123456789101112131415161718192021
  1. {% set form_id = form_id ? form_id : 'blueprints' %}
  2. <form id="{{ form_id }}" method="post" data-grav-form="{{ form_id }}" data-grav-keepalive="true">
  3. {% for field in blueprints.fields %}
  4. {% if field.type %}
  5. {% set value = data.value(field.name) %}
  6. <div class="block block-{{ field.type }}">
  7. {% include ["forms/fields/#{field.type}/#{field.type}.html.twig", 'forms/fields/text/text.html.twig'] %}
  8. </div>
  9. {% endif %}
  10. {% endfor %}
  11. {% if data.extra %}
  12. {% for name, value in data.extra %}
  13. {% set field = {name: '_json.' ~ name} %}
  14. {% set value = value|json_encode|e %}
  15. {% include 'forms/fields/hidden/hidden.html.twig' %}
  16. {% endfor %}
  17. {% endif %}
  18. </form>