You are here

webform-composite-contact.html.twig in Webform 6.x

Same filename and directory in other branches
  1. 8.5 templates/webform-composite-contact.html.twig

Default theme implementation of a contact composite webform element.

Available variables:

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

File

templates/webform-composite-contact.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation of a contact composite webform element.
  5. *
  6. * Available variables:
  7. * - content: The contact webform element to be output.
  8. * - flexbox: Determines if Flexbox layout should be applied to the composite
  9. * element.
  10. *
  11. * @see template_preprocess_webform_composite_contact()
  12. *
  13. * @ingroup themeable
  14. */
  15. #}
  16. {% if flexbox %}
  17. <div class="webform-contact">
  18. {% if content.name or content.company %}
  19. <div class="webform-flexbox webform-contact__row-1">
  20. {% if content.name %}
  21. <div class="webform-flex webform-flex--1 webform-address__name"><div class="webform-flex--container">{{ content.name }}</div></div>
  22. {% endif %}
  23. {% if content.company %}
  24. <div class="webform-flex webform-flex--1 webform-address__company"><div class="webform-flex--container">{{ content.company }}</div></div>
  25. {% endif %}
  26. </div>
  27. {% endif %}
  28. {% if content.email or content.phone %}
  29. <div class="webform-flexbox webform-contact__row-2">
  30. {% if content.email %}
  31. <div class="webform-flex webform-flex--1 webform-address__email"><div class="webform-flex--container">{{ content.email }}</div></div>
  32. {% endif %}
  33. {% if content.phone %}
  34. <div class="webform-flex webform-flex--1 webform-address__phone"><div class="webform-flex--container">{{ content.phone }}</div></div>
  35. {% endif %}
  36. </div>
  37. {% endif %}
  38. {% if content.address %}
  39. <div class="webform-flexbox webform-contact__row-3">
  40. <div class="webform-flex webform-flex--1 webform-address__address"><div class="webform-flex--container">{{ content.address }}</div></div>
  41. </div>
  42. {% endif %}
  43. {% if content.address_2 %}
  44. <div class="webform-flexbox webform-contact__row-4">
  45. <div class="webform-flex webform-flex--1 webform-address__address-2"><div class="webform-flex--container">{{ content.address_2 }}</div></div>
  46. </div>
  47. {% endif %}
  48. {% if content.city or content.state_province or content.postal_code %}
  49. <div class="webform-flexbox webform-contact__row-5">
  50. {% if content.city %}
  51. <div class="webform-flex webform-flex--1 webform-address__city"><div class="webform-flex--container">{{ content.city }}</div></div>
  52. {% endif %}
  53. {% if content.state_province %}
  54. <div class="webform-flex webform-flex--1 webform-address__province"><div class="webform-flex--container">{{ content.state_province }}</div></div>
  55. {% endif %}
  56. {% if content.postal_code %}
  57. <div class="webform-flex webform-flex--1 webform-address__postal-code"><div class="webform-flex--container">{{ content.postal_code }}</div></div>
  58. {% endif %}
  59. </div>
  60. {% endif %}
  61. {% if content.country %}
  62. <div class="webform-flexbox webform-contact__row-6">
  63. <div class="webform-flex webform-flex--1 webform-address__country"><div class="webform-flex--container">{{ content.country }}</div></div>
  64. </div>
  65. {% endif %}
  66. </div>
  67. {% else %}
  68. {{ content }}
  69. {% endif %}