You are here

yamlform-container-base-html.html.twig in YAML Form 8

Default theme implementation for a form base container as html.

Available variables:

  • element: The form element.
  • id: The form element id.
  • title: The label for the container.
  • value: The content for the container.
  • options Associative array of options for element.
    • email: Flag to determine if element is for an email.

File

templates/yamlform-container-base-html.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation for a form base container as html.
  5. *
  6. * Available variables:
  7. * - element: The form element.
  8. * - id: The form element id.
  9. * - title: The label for the container.
  10. * - value: The content for the container.
  11. * - options Associative array of options for element.
  12. * - email: Flag to determine if element is for an email.
  13. */
  14. #}
  15. {% if options.email %}
  16. <h3>{{ title }}</h3>
  17. {{ value }}
  18. {% else %}
  19. <details data-yamlform-element-id="{{ id }}" open="open">
  20. <summary role="button" aria-expanded="true" aria-pressed="true">{{ title }}</summary>
  21. <div class="details-wrapper">{{ value }}</div>
  22. </details>
  23. {% endif %}