You are here

username.html.twig in Commerce Core 8.2

Default theme implementation for displaying a username in a mail.

Available variables:

  • account: The full account information for the user.
  • name: The user's name, sanitized.
  • extra: Additional text to append to the user's name, sanitized.
  • link_path: The path or URL of the user's profile page, home page, or other desired page to link to for more information about the user.
  • link_options: Options to pass to the url() function's $options parameter if linking the user's name to the user's page.
  • attributes: HTML attributes for the containing element.

File

tests/themes/commerce_test_theme/templates/username.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation for displaying a username in a mail.
  5. *
  6. * Available variables:
  7. * - account: The full account information for the user.
  8. * - name: The user's name, sanitized.
  9. * - extra: Additional text to append to the user's name, sanitized.
  10. * - link_path: The path or URL of the user's profile page, home page,
  11. * or other desired page to link to for more information about the user.
  12. * - link_options: Options to pass to the url() function's $options parameter if
  13. * linking the user's name to the user's page.
  14. * - attributes: HTML attributes for the containing element.
  15. *
  16. * @see template_preprocess_username()
  17. *
  18. * @ingroup themeable
  19. */
  20. #}
  21. <p>Commerce test theme</p>
  22. {% if link_path -%}
  23. <a{{ attributes }}>{{ name }}{{ extra }}</a>
  24. {%- else -%}
  25. <span{{ attributes }}>{{ name }}{{ extra }}</span>
  26. {%- endif -%}