You are here

username.html.twig in Zircon Profile 8.0

Default theme implementation for displaying a username.

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

core/modules/user/templates/username.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation for displaying a username.
  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. {% if link_path -%}
  22. <a{{ attributes }}>{{ name }}{{ extra }}</a>
  23. {%- else -%}
  24. <span{{ attributes }}>{{ name }}{{ extra }}</span>
  25. {%- endif -%}

Related topics