You are here

webform-element-base-text.html.twig in Webform 6.x

Same filename and directory in other branches
  1. 8.5 templates/webform-element-base-text.html.twig

Default theme implementation for a webform base element as text.

Available variables:

  • element: The webform element.
  • title: The label for the element.
  • value: The content for the element.
  • options Associative array of options for element.
    • email: Flag to determine if element is for an email.
    • multiline: Flag to determine if value spans multiple lines.
    • first: Flag to determine if the element is that first element in its container.
    • last: Flag to determine if the element is that last element in its container.

File

templates/webform-element-base-text.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation for a webform base element as text.
  5. *
  6. * Available variables:
  7. * - element: The webform element.
  8. * - title: The label for the element.
  9. * - value: The content for the element.
  10. * - options Associative array of options for element.
  11. * - email: Flag to determine if element is for an email.
  12. * - multiline: Flag to determine if value spans multiple lines.
  13. * - first: Flag to determine if the element is that first element in its container.
  14. * - last: Flag to determine if the element is that last element in its container.
  15. *
  16. * @see \Drupal\webform\WebformSubmissionViewBuilder::buildElements
  17. */
  18. #}
  19. {% if title %}{{ title }}{% if options.multiline %}:
  20. {% else %}: {% endif %}{% endif %}{{ value }}
  21. {% if options.multiline and not options.last %}
  22. {% endif %}