-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbooster_theme.theme
More file actions
39 lines (34 loc) · 1.06 KB
/
booster_theme.theme
File metadata and controls
39 lines (34 loc) · 1.06 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
<?php
/**
* @file
* Theme functions.
*/
// Include all files from the includes directory.
$includes_path = dirname(__FILE__) . '/includes/*.theme';
foreach (glob($includes_path) as $file) {
require_once dirname(__FILE__) . '/includes/' . basename($file);
}
/**
* Implements hook_preprocess_HOOK().
*/
function booster_theme_preprocess_block__block_content__type__banner(&$variables) {
if (!empty($variables['content']['field_cta_links'][0])) {
$variables['content']['field_cta_links'][0]['#attributes']['class'][] = 'btn btn-primary';
}
if (!empty($variables['content']['field_cta_links'][1])) {
$variables['content']['field_cta_links'][1]['#attributes']['class'][] = 'btn btn-secondary';
}
}
/**
* Implements hook_preprocess_HOOK().
*/
function booster_theme_preprocess_block__block_content__type__carousel(&$variables) {
if (!empty($variables['content']['field_items'])) {
foreach ($variables['content']['field_items'] as $key => $item) {
if (!is_numeric($key)) {
continue;
}
$variables['slides'][] = $item;
}
}
}