diff --git a/web/themes/custom/reha/reha.theme b/web/themes/custom/reha/reha.theme index b463772..cfba2bc 100644 --- a/web/themes/custom/reha/reha.theme +++ b/web/themes/custom/reha/reha.theme @@ -5,7 +5,7 @@ use Drupal\Core\Url; use Drupal\Core\Link; use Drupal\Core\Render\Markup; use Drupal\Component\Utility\Html; - +use Drupal\user\Entity\User; /** * @file @@ -102,5 +102,15 @@ function reha_preprocess_block(&$variables) { } } } + + + if ($variables['plugin_id'] === "views_block:current_user_block-block_1") { + $user = User::load($variables['user']->id()); + $prenomnom = $user->get('field_prenom')->getString() . ' ' . $user->get('field_nom')->getString(); + $variables['content']['#title']['#markup'] = $prenomnom; + $variables['label']['#markup'] = $prenomnom; + } + + } diff --git a/web/themes/custom/reha/templates/block--views-block--current-user-block-block-1.html.twig b/web/themes/custom/reha/templates/block--views-block--current-user-block-block-1.html.twig index 28e0c2a..f295b44 100644 --- a/web/themes/custom/reha/templates/block--views-block--current-user-block-block-1.html.twig +++ b/web/themes/custom/reha/templates/block--views-block--current-user-block-block-1.html.twig @@ -47,7 +47,7 @@
-

Informations personnelles

+

Informations personnelles

{{ content }}