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.twigView source
- {#
- /**
- * @file
- * 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 template_preprocess_yamlform_contact()
- *
- * @ingroup themeable
- */
- #}
- {{ attach_library('yamlform/yamlform.element.composite') }}
- {% if flexbox %}
-
- {% if content.name or content.company %}
- <div class="yamlform-flexbox">
- {% if content.name %}
- <div class="yamlform-flex yamlform-flex--1"><div class="yamlform-flex--container">{{ content.name }}</div></div>
- {% endif %}
- {% if content.company %}
- <div class="yamlform-flex yamlform-flex--1"><div class="yamlform-flex--container">{{ content.company }}</div></div>
- {% endif %}
- </div>
- {% endif %}
-
- {% if content.email or content.phone %}
- <div class="yamlform-flexbox">
- {% if content.email %}
- <div class="yamlform-flex yamlform-flex--1"><div class="yamlform-flex--container">{{ content.email }}</div></div>
- {% endif %}
- {% if content.phone %}
- <div class="yamlform-flex yamlform-flex--1"><div class="yamlform-flex--container">{{ content.phone }}</div></div>
- {% endif %}
- </div>
- {% endif %}
-
- {% if content.address %}
- <div class="yamlform-flexbox">
- <div class="yamlform-flex yamlform-flex--1"><div class="yamlform-flex--container">{{ content.address }}</div></div>
- </div>
- {% endif %}
-
- {% if content.address_2 %}
- <div class="yamlform-flexbox">
- <div class="yamlform-flex yamlform-flex--1"><div class="yamlform-flex--container">{{ content.address_2 }}</div></div>
- </div>
- {% endif %}
-
- <div class="yamlform-flexbox">
- {% if content.city %}
- <div class="yamlform-flex yamlform-flex--1"><div class="yamlform-flex--container">{{ content.city }}</div></div>
- {% endif %}
- {% if content.state_province %}
- <div class="yamlform-flex yamlform-flex--1"><div class="yamlform-flex--container">{{ content.state_province }}</div></div>
- {% endif %}
- {% if content.postal_code %}
- <div class="yamlform-flex yamlform-flex--1"><div class="yamlform-flex--container">{{ content.postal_code }}</div></div>
- {% endif %}
- </div>
-
- {% if content.country %}
- <div class="yamlform-flexbox">
- <div class="yamlform-flex yamlform-flex--1"><div class="yamlform-flex--container">{{ content.country }}</div></div>
- </div>
- {% endif %}
-
- {% else %}
- {{ content }}
- {% endif %}