summaryrefslogtreecommitdiffstats
path: root/core/profiles/demo_umami/demo_umami.profile
diff options
context:
space:
mode:
Diffstat (limited to 'core/profiles/demo_umami/demo_umami.profile')
-rw-r--r--core/profiles/demo_umami/demo_umami.profile18
1 files changed, 13 insertions, 5 deletions
diff --git a/core/profiles/demo_umami/demo_umami.profile b/core/profiles/demo_umami/demo_umami.profile
index 02a5853..dc8384f 100644
--- a/core/profiles/demo_umami/demo_umami.profile
+++ b/core/profiles/demo_umami/demo_umami.profile
@@ -34,8 +34,17 @@ function demo_umami_toolbar() {
// @todo: This can be removed once a generic warning for experimental profiles has been introduced.
// @see https://www.drupal.org/project/drupal/issues/2934374
$items['experimental-profile-warning'] = [
- '#type' => 'toolbar_item',
- 'tab' => [
+ '#weight' => 999,
+ '#cache' => [
+ 'contexts' => ['route'],
+ ],
+ ];
+
+ // Show warning only on administration pages.
+ $admin_context = \Drupal::service('router.admin_context');
+ if ($admin_context->isAdminRoute()) {
+ $items['experimental-profile-warning']['#type'] = 'toolbar_item';
+ $items['experimental-profile-warning']['tab'] = [
'#type' => 'inline_template',
'#template' => '<a class="toolbar-warning" href="{{ more_info_link }}">This installation is for demonstration purposes only.</a>',
'#context' => [
@@ -44,8 +53,7 @@ function demo_umami_toolbar() {
'#attached' => [
'library' => ['demo_umami/toolbar-warning'],
],
- ],
- '#weight' => 999,
- ];
+ ];
+ }
return $items;
}