-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathviews.inc
42 lines (36 loc) · 1.19 KB
/
views.inc
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
<?php
/**
* @file
* Views-related hook implementations.
*/
/**
* Implements hook_preprocess_HOOK().
*/
function gesso_preprocess_views_view(array &$variables) {
/** @var \Drupal\views\ViewExecutable $view */
$view = $variables['view'];
$variables['path'] = $view->getRequest()->getPathInfo();
if (empty($variables['title'])) {
$variables['title'] = [
'#markup' => $view->getTitle(),
];
}
}
/**
* Implements hook_theme_suggestions_HOOK_alter().
*/
function gesso_theme_suggestions_views_view_alter(array &$suggestions, array $variables) {
$view = $variables['view'];
$suggestions[] = 'views_view__' . $view->id();
$suggestions[] = 'views_view__' . $view->current_display;
$suggestions[] = 'views_view__' . $view->id() . '__' . $view->current_display;
}
/**
* Implements hook_theme_suggestions_HOOK_alter().
*/
function gesso_theme_suggestions_views_view_unformatted_alter(array &$suggestions, array $variables) {
$view = $variables['view'];
$suggestions[] = 'views_view_unformatted__' . $view->id();
$suggestions[] = 'views_view_unformatted__' . $view->current_display;
$suggestions[] = 'views_view_unformatted__' . $view->id() . '__' . $view->current_display;
}