-
Notifications
You must be signed in to change notification settings - Fork 12
/
template.php
112 lines (89 loc) · 2.79 KB
/
template.php
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<?php
/*
Preprocess
*/
function parrot_preprocess_html(&$vars) {
// kpr($vars['content']);
}
function parrot_preprocess_page(&$vars,$hook) {
//typekit
//drupal_add_js('http://use.typekit.com/XXX.js', 'external');
//drupal_add_js('try{Typekit.load();}catch(e){}', array('type' => 'inline'));
//webfont
//drupal_add_css('http://cloud.webtype.com/css/CXXXX.css','external');
drupal_add_css('//maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css','external');
//googlefont
// drupal_add_css('http://fonts.googleapis.com/css?family=Bree+Serif','external');
// If this is a panel page, add template suggestions.
// Must have Ctools Page Manager enabled. Uncomment to use.
if (module_exists('page_manager')) {
if($panel_page = page_manager_get_current_page()) {
// add a generic suggestion for all panel pages
$vars['theme_hook_suggestions'][] = 'page__panel';
// add the panel page machine name to the template suggestions
$vars['theme_hook_suggestions'][] = 'page__' . $panel_page['name'];
//add a body class for good measure
$body_classes[] = 'page-panel';
}
}
}
function parrot_preprocess_region(&$vars,$hook) {
// kpr($vars['content']);
}
function parrot_preprocess_block(&$vars, $hook) {
// kpr($vars['content']);
//lets look for unique block in a region $region-$blockcreator-$delta
$block =
$vars['elements']['#block']->region .'-'.
$vars['elements']['#block']->module .'-'.
$vars['elements']['#block']->delta;
// print $block .' ';
switch ($block) {
case 'header-menu_block-2':
$vars['classes_array'][] = '';
break;
case 'sidebar-system-navigation':
$vars['classes_array'][] = '';
break;
default:
break;
}
switch ($vars['elements']['#block']->region) {
case 'header':
$vars['classes_array'][] = '';
break;
case 'sidebar':
$vars['classes_array'][] = '';
$vars['classes_array'][] = '';
break;
default:
break;
}
}
function parrot_preprocess_node(&$vars,$hook) {
// kpr($vars['content']);
}
function parrot_preprocess_comment(&$vars,$hook) {
// kpr($vars['content']);
}
function parrot_preprocess_field(&$vars,$hook) {
// kpr($vars['content']);
//add class to a specific field
switch ($vars['element']['#field_name']) {
case 'field_ROCK':
$vars['classes_array'][] = 'classname1';
case 'field_ROLL':
$vars['classes_array'][] = 'classname1';
$vars['classes_array'][] = 'classname2';
$vars['classes_array'][] = 'classname1';
case 'field_FOO':
$vars['classes_array'][] = 'classname1';
case 'field_BAR':
$vars['classes_array'][] = 'classname1';
default:
break;
}
}
function parrot_preprocess_maintenance_page(){
// kpr($vars['content']);
}