diff --git a/core/includes/theme.inc b/core/includes/theme.inc index e8cff8b..7aaa70a 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -1259,6 +1259,7 @@ function template_preprocess_html(&$variables) { $system_path = \Drupal::service('path.current')->getPath(); $variables['root_path'] = explode('/', $system_path)[1]; } + $variables['base_path'] = base_path(); $site_config = \Drupal::config('system.site'); // Construct page title. diff --git a/core/modules/system/templates/html.html.twig b/core/modules/system/templates/html.html.twig index 39702c2..43ce0ce 100644 --- a/core/modules/system/templates/html.html.twig +++ b/core/modules/system/templates/html.html.twig @@ -5,6 +5,8 @@ * * Variables: * - logged_in: A flag indicating if user is logged in. + * - base_path: The base URL path of the Drupal installation. Will usually be + * "/" unless you have installed Drupal in a sub-directory. * - root_path: The root path of the current page (e.g., node, admin, user). * - node_type: The content type for the current node, if the page is a node. * - head_title: List of text elements that make up the head_title variable. diff --git a/core/themes/classy/templates/layout/html.html.twig b/core/themes/classy/templates/layout/html.html.twig index b787ed1..2ba07b7 100644 --- a/core/themes/classy/templates/layout/html.html.twig +++ b/core/themes/classy/templates/layout/html.html.twig @@ -5,6 +5,8 @@ * * Variables: * - logged_in: A flag indicating if user is logged in. + * - base_path: The base URL path of the Drupal installation. Will usually be + * "/" unless you have installed Drupal in a sub-directory. * - root_path: The root path of the current page (e.g., node, admin, user). * - node_type: The content type for the current node, if the page is a node. * - head_title: List of text elements that make up the head_title variable.