diff --git a/core/modules/user/templates/user.html.twig b/core/modules/user/templates/user.html.twig index 2f6f640..f5bd2b6 100644 --- a/core/modules/user/templates/user.html.twig +++ b/core/modules/user/templates/user.html.twig @@ -23,7 +23,12 @@ * @ingroup themeable */ #} - +{% + set classes = [ + 'profile', + ] +%} + {% if content %} {{- content -}} {% endif %} diff --git a/core/modules/user/templates/username.html.twig b/core/modules/user/templates/username.html.twig index 5d4f2f7..06562c4 100644 --- a/core/modules/user/templates/username.html.twig +++ b/core/modules/user/templates/username.html.twig @@ -18,8 +18,13 @@ * @ingroup themeable */ #} +{% + set classes = [ + 'username', + ] +%} {% if link_path -%} - {{ name }}{{ extra }} + {{ name }}{{ extra }} {%- else -%} {{ name }}{{ extra }} {%- endif -%} diff --git a/core/modules/user/user.module b/core/modules/user/user.module index 75777bb..49850f3 100644 --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -625,11 +625,7 @@ function template_preprocess_username(&$variables) { $variables['link_path'] = $account->homepage; $variables['homepage'] = $account->homepage; } - // Set a default class. - $variables['attributes']['class'] = array('username'); // We have a link path, so we should generate a link using url(). - // Additional classes may be added as array elements like - // $variables['attributes']['class'][] = 'myclass'; if (isset($variables['link_path'])) { $variables['attributes']['href'] = url($variables['link_path'], $variables['link_options']); } diff --git a/core/modules/user/user.pages.inc b/core/modules/user/user.pages.inc index 4a09d7b..b548e3b 100644 --- a/core/modules/user/user.pages.inc +++ b/core/modules/user/user.pages.inc @@ -29,9 +29,6 @@ function template_preprocess_user(&$variables) { foreach (Element::children($variables['elements']) as $key) { $variables['content'][$key] = $variables['elements'][$key]; } - - // Set up attributes. - $variables['attributes']['class'][] = 'profile'; } /**