diff --git a/core/modules/navigation/src/Plugin/TopBarItem/PageContext.php b/core/modules/navigation/src/Plugin/TopBarItem/PageContext.php index 76448d0f6a65ebfe28221b86aec4dd28758e31f0..49078ef95cc02b856921f080b49680516aeb1148 100644 --- a/core/modules/navigation/src/Plugin/TopBarItem/PageContext.php +++ b/core/modules/navigation/src/Plugin/TopBarItem/PageContext.php @@ -85,21 +85,23 @@ public function build(): array { return $build; } - $build += [ - [ - '#type' => 'component', - '#component' => 'navigation:title', - '#props' => [ - 'icon' => 'database', - 'html_tag' => 'span', - 'modifiers' => ['ellipsis', 'xs'], - 'extra_classes' => ['top-bar__title'], - ], - '#slots' => [ - 'content' => $entity->label(), + if ($label = $entity->label()) { + $build += [ + [ + '#type' => 'component', + '#component' => 'navigation:title', + '#props' => [ + 'icon' => 'database', + 'html_tag' => 'span', + 'modifiers' => ['ellipsis', 'xs'], + 'extra_classes' => ['top-bar__title'], + ], + '#slots' => [ + 'content' => $label, + ], ], - ], - ]; + ]; + } if ($label = $this->getBadgeLabel($entity)) { $build += [