-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.php
39 lines (33 loc) · 987 Bytes
/
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
<?php
/**
* @file
* The primary PHP file for this theme.
*/
/**
* hook_preprocess_page()
*/
function valls_preprocess_page(&$vars, $hook) {
_valls_add_font();
if (!empty($vars['node']) && $vars['node']->type == 'work') {
_valls_alter_work_title($vars);
}
}
/**
* Add artist data to the Artwork title
*/
function _valls_alter_work_title(&$vars) {
if (!empty($vars['node']->field_artist_name['und'][0]['value'])) {
$vars['title_prefix'] = '<div class="page-header artist">';
$vars['title_prefix'] .= '<div class="artist-name">' . $vars['node']->field_artist_name['und'][0]['value'] . '</div>';
if (!empty($vars['node']->field_artist_years['und'][0]['value'])) {
$vars['title_prefix'] .= '<div class="artist-years">' . $vars['node']->field_artist_years['und'][0]['value'] . '</div>';
}
$vars['title_prefix'] .= '</div>';
}
}
/**
* Add font
*/
function _valls_add_font() {
drupal_add_js('//use.typekit.net/nwe1kps.js', 'external');
}