diff --git a/core/modules/system/system.tokens.inc b/core/modules/system/system.tokens.inc index d046f6d9b7..f6674084c1 100644 --- a/core/modules/system/system.tokens.inc +++ b/core/modules/system/system.tokens.inc @@ -24,6 +24,10 @@ function system_token_info() { 'description' => t("Tokens related to times and dates."), ]; + // Obtain a list of installed themes. + $themes = \Drupal::service('theme_handler')->listInfo(); + $themes_formatted = implode(array_keys($themes)); + // Site-wide global tokens. $site['name'] = [ 'name' => t("Name"), @@ -39,11 +43,13 @@ function system_token_info() { ]; $site['logo'] = [ 'name' => t("Logo"), - 'description' => t("The default site logo."), + 'description' => t("The default site logo [site:logo], or for a provided theme [site:logo:?] (Available themes: @themes).", ['@themes' => $themes_formatted]), + 'dynamic' => TRUE, ]; $site['logo-url'] = [ 'name' => t("Logo URL"), - 'description' => t("The URL of the default site logo."), + 'description' => t("The URL of the default site logo [site:logo], or for a provided theme [site:logo:?] (Available themes: @themes).", ['@themes' => $themes_formatted]), + 'dynamic' => TRUE, ]; $site['url'] = [ 'name' => t("URL"), @@ -57,20 +63,6 @@ function system_token_info() { 'name' => t("Login page"), 'description' => t("The URL of the site's login page."), ]; - // Add additional tokens for logo's per theme. - $themes = \Drupal::service('theme_handler')->listInfo(); - foreach ($themes as $theme_name => $theme) { - if (!isset($site['logo'][$theme_name]) || !isset($site['logo-url'][$theme_name])) { - $site['logo'][$theme_name] = [ - 'name' => Html::escape($theme->info['name']), - 'description' => t("The site logo for the %theme theme", array('%theme' => $theme->info['name'])), - ]; - $site['logo-url'][$theme_name] = [ - 'name' => Html::escape($theme->info['name']), - 'description' => t("The site logo url for the %theme theme", array('%theme' => $theme->info['name'])), - ]; - } - } // Date related tokens. $date['short'] = [