Browse Source

head title always = only site name

Bachir Soussi Chiadmi 6 years ago
parent
commit
b6dfcd4485
1 changed files with 17 additions and 2 deletions
  1. 17 2
      sites/all/themes/custom/edlptheme/edlptheme.theme

+ 17 - 2
sites/all/themes/custom/edlptheme/edlptheme.theme

@@ -22,7 +22,22 @@ use Drupal\Core\Render\Element;
 //   dpm('edlptheme_page_attachments', $attachments);
 // }
 
-
+/**
+ * Prepares variables for HTML document templates.
+ *
+ * Default template: html.html.twig.
+ *
+ * @param array $variables
+ *   An associative array containing:
+ *   - page: A render element representing the page.
+ */
+function edlptheme_preprocess_html(&$vars) {
+  $site_config = \Drupal::config('system.site');
+  $head_title = [
+    'name' => $site_config->get('name'),
+  ];
+  $vars['head_title'] = $head_title;
+}
 
 function edlptheme_preprocess_page(&$vars){
   // dsm($vars, 'vars');
@@ -250,5 +265,5 @@ function edlptheme_preprocess_links__language_block(&$vars){
 }
 
 function edlptheme_preprocess_file_link(&$vars){
-  
+
 }