You are here

yamlform-composite-address.html.twig in YAML Form 8

Default theme implementation of an address composite form element.

Available variables:

  • content: The address form element to be output.
  • flexbox: Determines if Flexbox layout should be applied to the composite element.

See also

template_preprocess_yamlform_name()

File

templates/yamlform-composite-address.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation of an address composite form element.
  5. *
  6. * Available variables:
  7. * - content: The address form element to be output.
  8. * - flexbox: Determines if Flexbox layout should be applied to the composite
  9. * element.
  10. *
  11. * @see template_preprocess_yamlform_name()
  12. *
  13. * @ingroup themeable
  14. */
  15. #}
  16. {{ attach_library('yamlform/yamlform.element.composite') }}
  17. {% if flexbox %}
  18. {% if content.address %}
  19. <div class="yamlform-flexbox">
  20. <div class="yamlform-flex yamlform-flex--1"><div class="yamlform-flex--container">{{ content.address }}</div></div>
  21. </div>
  22. {% endif %}
  23. {% if content.address_2 %}
  24. <div class="yamlform-flexbox">
  25. <div class="yamlform-flex yamlform-flex--1"><div class="yamlform-flex--container">{{ content.address_2 }}</div></div>
  26. </div>
  27. {% endif %}
  28. <div class="yamlform-flexbox">
  29. {% if content.city %}
  30. <div class="yamlform-flex yamlform-flex--1"><div class="yamlform-flex--container">{{ content.city }}</div></div>
  31. {% endif %}
  32. {% if content.state_province %}
  33. <div class="yamlform-flex yamlform-flex--1"><div class="yamlform-flex--container">{{ content.state_province }}</div></div>
  34. {% endif %}
  35. {% if content.postal_code %}
  36. <div class="yamlform-flex yamlform-flex--1"><div class="yamlform-flex--container">{{ content.postal_code }}</div></div>
  37. {% endif %}
  38. </div>
  39. {% if content.country %}
  40. <div class="yamlform-flexbox">
  41. <div class="yamlform-flex yamlform-flex--1"><div class="yamlform-flex--container">{{ content.country }}</div></div>
  42. </div>
  43. {% endif %}
  44. {% else %}
  45. {{ content }}
  46. {% endif %}