-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoutline.theme
29 lines (25 loc) · 884 Bytes
/
outline.theme
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
<?php
/**
* Implements hook_theme_suggestions_page_alter().
*/
function outline_theme_suggestions_form_element_alter(array &$suggestions, array $variables) {
if(in_array($variables['element']['#type'], ['checkbox', 'radio'])) {
$suggestions[] = 'form_element__checkbox';
} else {
$suggestions[] = 'form_element__' . $variables['element']['#type'];
}
}
function outline_theme_suggestions_container_alter(array &$suggestions, array $variables) {
if($variables['element']['#type'] == 'actions') {
$suggestions[] = 'container__actions';
}
}
function outline_theme_suggestions_menu_alter(array &$suggestions, array $variables) {
// remove suggestions by menu extras in favour of suggestion provided by
// menu block
foreach ($suggestions as $key => $value) {
if (substr($value, 0, 12) === 'menu__extras') {
unset($suggestions[$key]);
}
}
}