-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathebi_framework.theme
More file actions
70 lines (60 loc) · 2.13 KB
/
ebi_framework.theme
File metadata and controls
70 lines (60 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
use Drupal\image\Entity\ImageStyle;
use Drupal\file\Entity\File;
// Add your custom theme override functions here.
/**
* Implements hook_preprocess_block()
*/
function ebi_framework_preprocess_block(&$variables) {
}
/**
* Implements template_preprocess_field().
*/
function ebi_framework_preprocess_field(&$variables) {
}
/**
* Implements template_preprocess_html().
*
* Adds additional classes
*/
function ebi_framework_preprocess_html(&$variables) {
}
/**
* Implements template_preprocess_node
*
* Add template suggestions and classes
*/
function ebi_framework_preprocess_node(&$variables) {
}
/**
* Implements template_preprocess_page
*
* Add convenience variables and template suggestions
*/
function ebi_framework_preprocess_page(&$variables) {
// Add classes to highlighted region.
if (!empty($variables['page']['highlighted'])) {
$variables['page']['highlighted']['#attributes']['class'] = ['region-highlighted'];
}
// Pass EBI Theme settings variables.
$variables['enable_copyright_footer'] = theme_get_setting('enable_copyright_footer');
$variables['enable_ebi_footer'] = theme_get_setting('enable_ebi_footer');
$variables['enable_header_bar'] = theme_get_setting('enable_header_bar');
$variables['header_background_color'] = theme_get_setting('header_background_color');
$variables['header_type'] = theme_get_setting('header_type');
$header_background_images = [];
$header_background_images = theme_get_setting('header_background_images');
if (!empty($header_background_images)) {
$header_background_images_files = File::loadMultiple($header_background_images); //file_load_multiple($header_background_images);
$header_background_images = [];
foreach ($header_background_images_files as $header_background_images_file) {
$image_url = ImageStyle::load('header_background_1350x380')->buildUrl($header_background_images_file->getFileUri());
$header_background_images[] = $image_url;
}
$variables['header_background_images'] = $header_background_images;
}
}
/**
* Implements template_preprocess_views_view().
*/
function ebi_framework_preprocess_views_view(&$variables) {}