-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpurdue-drupal-theme.theme
44 lines (43 loc) · 1.26 KB
/
purdue-drupal-theme.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
/**
* Implements hook_preprocess_HOOK() for field.html.twig.
*/
function purduehub_preprocess_page(&$variables) {
$variables['site_name'] = \Drupal::config('system.site')->get('name');
$variables['logo'] = theme_get_setting('logo.url');
}
/**
* Changes the search box placeholder
*/
function purduehub_form_search_block_form_alter(&$form, &$form_state) {
$form['keys']['#attributes']['placeholder'][] = t('What are you looking for?');
$form['actions']['submit']['#value'] = html_entity_decode('');
}
/**
* Implements template_preprocess_views_view()
* @param array $vars
*/
function purduehub_preprocess_views_view(&$vars){
$vars['more']['#options']['attributes']['class'] = array(
'view_more',
);
}
/**
* Hides Page title in pages and Podcasts
*/
function purduehub_preprocess_page_title(&$variables) {
$node = \Drupal::routeMatch()->getParameter('node');
if( $node ) {
if( $node->getType() == 'page' || $node->getType() == 'podcast' ) {
$variables['title'] = "";
}
}
}
/**
* Implements hook_theme_suggestions_page_alter().
*/
function purduehub_theme_suggestions_page_alter(array &$suggestions, array $variables) {
if ($node = \Drupal::routeMatch()->getParameter('node')) {
$suggestions[] = 'page__' . $node->bundle();
}
}