user name in header
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@
|
||||
<div class="connected">
|
||||
<div class="connected-full">
|
||||
<section class="titre">
|
||||
<p> Informations personnelles </p>
|
||||
<p>Informations personnelles</p>
|
||||
</section>
|
||||
|
||||
{{ content }}
|
||||
|
||||
Reference in New Issue
Block a user