Yaffs site version 1.1
[yaffs-website] / vendor / drupal / console / templates / theme / theme.twig
1 <?php
2
3 /**
4  * @file
5  * Functions to support theming in the {{ machine_name }} theme.
6  */
7
8 /**
9  * Implements hook_preprocess_HOOK() for html.html.twig.
10  */
11 function {{ machine_name }}_preprocess_html(array &$variables) {
12   /* Add class to html tag */
13   //$variables['html_attributes']->addClass('no-js');
14
15   // Don't display the site name twice on the front page (and potentially others)
16   /*if (isset($variables['head_title_array']['title']) && isset($variables['head_title_array']['name']) && ($variables['head_title_array']['title'] == $variables['head_title_array']['name'])) {
17     $variables['head_title'] = $variables['head_title_array']['name'];
18   }*/
19 }
20
21 /**
22  * Implements hook_page_attachments_alter().
23  */
24 function {{ machine_name }}_page_attachments_alter(array &$page) {
25   // Tell IE to use latest rendering engine (not to use compatibility mode).
26   /*$ie_edge = [
27     '#type' => 'html_tag',
28     '#tag' => 'meta',
29     '#attributes' => [
30     'http-equiv' => 'X-UA-Compatible',
31     'content' => 'IE=edge',
32     ],
33   ];
34   $page['#attached']['html_head'][] = [$ie_edge, 'ie_edge'];*/
35 }
36
37 /**
38  * Implements hook_preprocess_page() for page.html.twig.
39  */
40 function {{ machine_name }}_preprocess_page(array &$variables) {
41
42 }
43
44 /**
45  * Implements hook_theme_suggestions_page_alter().
46  */
47 function {{ machine_name }}_theme_suggestions_page_alter(array &$suggestions, array $variables) {
48
49 }
50
51 /**
52  * Implements hook_theme_suggestions_node_alter().
53  */
54 function {{ machine_name }}_theme_suggestions_node_alter(array &$suggestions, array $variables) {
55   /*$node = $variables['elements']['#node'];
56
57   if ($variables['elements']['#view_mode'] == "full") {
58
59   }*/
60 }
61
62 /**
63  * Implements hook_preprocess_HOOK() for Block document templates.
64  */
65 function {{ machine_name }}_preprocess_block(array &$variables) {
66
67 }
68
69 /**
70  * Implements hook_theme_suggestions_field_alter().
71  */
72 function {{ machine_name }}_theme_suggestions_field_alter(array &$suggestions, array $variables) {
73   /*$element = $variables['element'];
74   $suggestions[] = 'field__' . $element['#view_mode'];
75   $suggestions[] = 'field__' . $element['#view_mode'] . '__' . $element['#field_name'];*/
76 }
77
78 /**
79  * Implements hook_theme_suggestions_field_alter().
80  */
81 function {{ machine_name }}_theme_suggestions_fieldset_alter(array &$suggestions, array $variables) {
82   /*$element = $variables['element'];
83   if (isset($element['#attributes']['class']) && in_array('form-composite', $element['#attributes']['class'])) {
84     $suggestions[] = 'fieldset__form_composite';
85   }*/
86 }
87
88 /**
89  * Implements hook_preprocess_node().
90  */
91 function {{ machine_name }}_preprocess_node(array &$variables) {
92   // Default to turning off byline/submitted.
93   //$variables['display_submitted'] = FALSE;
94 }
95
96 /**
97  * Implements hook_theme_suggestions_views_view_alter().
98  */
99 function {{ machine_name }}_theme_suggestions_views_view_alter(array &$suggestions, array $variables) {
100
101 }
102
103 /**
104  * Implements hook_preprocess_form().
105  */
106 function {{ machine_name }}_preprocess_form(array &$variables) {
107   //$variables['attributes']['novalidate'] = 'novalidate';
108 }
109
110 /**
111  * Implements hook_preprocess_select().
112  */
113 function {{ machine_name }}_preprocess_select(array &$variables) {
114   //$variables['attributes']['class'][] = 'select-chosen';
115 }
116
117 /**
118  * Implements hook_preprocess_field().
119  */
120 function {{ machine_name }}_preprocess_field(array &$variables, $hook) {
121   /*switch ($variables['element']['#field_name']) {
122   }*/
123 }
124
125 /**
126  * Implements hook_preprocess_details().
127  */
128 function {{ machine_name }}_preprocess_details(array &$variables) {
129   /*$variables['attributes']['class'][] = 'details';
130   $variables['summary_attributes']['class'] = 'summary';*/
131 }
132
133 /**
134  * Implements hook_theme_suggestions_details_alter().
135  */
136 function {{ machine_name }}_theme_suggestions_details_alter(array &$suggestions, array $variables) {
137
138 }
139
140 /**
141  * Implements hook_preprocess_menu_local_task().
142  */
143 function {{ machine_name }}_preprocess_menu_local_task(array &$variables) {
144   //$variables['element']['#link']['url']->setOption('attributes', ['class'=>'rounded']);
145 }