annotate core/themes/classy/templates/user/username.html.twig @ 12:7a779792577d
Update Drupal core to v8.4.5 (via Composer)
author |
Chris Cannam |
date |
Fri, 23 Feb 2018 15:52:07 +0000 |
parents |
4c8ae668cc8c |
children |
|
rev |
line source |
Chris@0
|
1 {#
|
Chris@0
|
2 /**
|
Chris@0
|
3 * @file
|
Chris@0
|
4 * Theme override for displaying a username.
|
Chris@0
|
5 *
|
Chris@0
|
6 * Available variables:
|
Chris@0
|
7 * - account: The full account information for the user.
|
Chris@0
|
8 * - uid: The user ID, or zero if not a user. As used in anonymous comments.
|
Chris@0
|
9 * - name: The user's name, sanitized, and optionally truncated.
|
Chris@0
|
10 * - name_raw: The user's name, un-truncated.
|
Chris@0
|
11 * - truncated: Whether the user's name was truncated.
|
Chris@0
|
12 * - extra: Additional text to append to the user's name, sanitized.
|
Chris@0
|
13 * - profile_access: Whether the current user has permission to access this
|
Chris@0
|
14 users profile page.
|
Chris@0
|
15 * - link_path: The path or URL of the user's profile page, home page,
|
Chris@0
|
16 * or other desired page to link to for more information about the user.
|
Chris@0
|
17 * - homepage: (optional) The home page of the account, only set for non users.
|
Chris@0
|
18 * - link_options: Options to set on the \Drupal\Core\Url object if linking the
|
Chris@0
|
19 * user's name to the user's page.
|
Chris@0
|
20 * - attributes: HTML attributes for the containing element.
|
Chris@0
|
21 *
|
Chris@0
|
22 * @see template_preprocess_username()
|
Chris@0
|
23 */
|
Chris@0
|
24 #}
|
Chris@0
|
25 {% if link_path -%}
|
Chris@0
|
26 <a{{ attributes.addClass('username') }}>{{ name }}{{ extra }}</a>
|
Chris@0
|
27 {%- else -%}
|
Chris@0
|
28 <span{{ attributes }}>{{ name }}{{ extra }}</span>
|
Chris@0
|
29 {%- endif -%}
|