diff --git a/core/modules/user/templates/user.html.twig b/core/modules/user/templates/user.html.twig index c44448b..b00a744 100644 --- a/core/modules/user/templates/user.html.twig +++ b/core/modules/user/templates/user.html.twig @@ -23,7 +23,7 @@ * @ingroup themeable */ #} - + {% if content %} {{- content -}} {% endif %} diff --git a/core/modules/user/templates/username.html.twig b/core/modules/user/templates/username.html.twig index 7859376..5d4f2f7 100644 --- a/core/modules/user/templates/username.html.twig +++ b/core/modules/user/templates/username.html.twig @@ -19,7 +19,7 @@ */ #} {% if link_path -%} - {{ name }}{{ extra }} + {{ name }}{{ extra }} {%- else -%} {{ name }}{{ extra }} {%- endif -%} diff --git a/core/themes/classy/templates/user.html.twig b/core/themes/classy/templates/user.html.twig new file mode 100644 index 0000000..c44448b --- /dev/null +++ b/core/themes/classy/templates/user.html.twig @@ -0,0 +1,30 @@ +{# +/** + * @file + * Default theme implementation to present all user data. + * + * This template is used when viewing a registered user's page, + * e.g., example.com/user/123. 123 being the user's ID. + * + * Available variables: + * - content: A list of content items. Use 'content' to print all content, or + * print a subset such as 'content.field_example'. + * - Field variables: For each field attached to the user a corresponding + * variable is defined; e.g., account.field_example has a variable + * 'field_example' defined. When needing to access a field's raw values, + * developers/themers are strongly encouraged to use these variables. + * Otherwise they will have to explicitly specify the desired field language, + * e.g. account.field_example.en, thus overriding any language negotiation + * rule that was previously applied. + * - attributes: HTML attributes for the container element. + * + * @see template_preprocess_user() + * + * @ingroup themeable + */ +#} + + {% if content %} + {{- content -}} + {% endif %} + diff --git a/core/themes/classy/templates/username.html.twig b/core/themes/classy/templates/username.html.twig new file mode 100644 index 0000000..7859376 --- /dev/null +++ b/core/themes/classy/templates/username.html.twig @@ -0,0 +1,25 @@ +{# +/** + * @file + * 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. + * + * @see template_preprocess_username() + * + * @ingroup themeable + */ +#} +{% if link_path -%} + {{ name }}{{ extra }} +{%- else -%} + {{ name }}{{ extra }} +{%- endif -%}