You are here

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

Default theme implementation of a contact composite form element.

Available variables:

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

See also

template_preprocess_yamlform_contact()

File

templates/yamlform-composite-contact.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation of a contact composite form element.
  5. *
  6. * Available variables:
  7. * - content: The contact 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_contact()
  12. *
  13. * @ingroup themeable
  14. */
  15. #}
  16. {{ attach_library('yamlform/yamlform.element.composite') }}
  17. {% if flexbox %}
  18. {% if content.name or content.company %}
  19. <div class="yamlform-flexbox">
  20. {% if content.name %}
  21. <div class="yamlform-flex yamlform-flex--1"><div class="yamlform-flex--container">{{ content.name }}</div></div>
  22. {% endif %}
  23. {% if content.company %}
  24. <div class="yamlform-flex yamlform-flex--1"><div class="yamlform-flex--container">{{ content.company }}</div></div>
  25. {% endif %}
  26. </div>
  27. {% endif %}
  28. {% if content.email or content.phone %}
  29. <div class="yamlform-flexbox">
  30. {% if content.email %}
  31. <div class="yamlform-flex yamlform-flex--1"><div class="yamlform-flex--container">{{ content.email }}</div></div>
  32. {% endif %}
  33. {% if content.phone %}
  34. <div class="yamlform-flex yamlform-flex--1"><div class="yamlform-flex--container">{{ content.phone }}</div></div>
  35. {% endif %}
  36. </div>
  37. {% endif %}
  38. {% if content.address %}
  39. <div class="yamlform-flexbox">
  40. <div class="yamlform-flex yamlform-flex--1"><div class="yamlform-flex--container">{{ content.address }}</div></div>
  41. </div>
  42. {% endif %}
  43. {% if content.address_2 %}
  44. <div class="yamlform-flexbox">
  45. <div class="yamlform-flex yamlform-flex--1"><div class="yamlform-flex--container">{{ content.address_2 }}</div></div>
  46. </div>
  47. {% endif %}
  48. <div class="yamlform-flexbox">
  49. {% if content.city %}
  50. <div class="yamlform-flex yamlform-flex--1"><div class="yamlform-flex--container">{{ content.city }}</div></div>
  51. {% endif %}
  52. {% if content.state_province %}
  53. <div class="yamlform-flex yamlform-flex--1"><div class="yamlform-flex--container">{{ content.state_province }}</div></div>
  54. {% endif %}
  55. {% if content.postal_code %}
  56. <div class="yamlform-flex yamlform-flex--1"><div class="yamlform-flex--container">{{ content.postal_code }}</div></div>
  57. {% endif %}
  58. </div>
  59. {% if content.country %}
  60. <div class="yamlform-flexbox">
  61. <div class="yamlform-flex yamlform-flex--1"><div class="yamlform-flex--container">{{ content.country }}</div></div>
  62. </div>
  63. {% endif %}
  64. {% else %}
  65. {{ content }}
  66. {% endif %}