-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.php
executable file
·46 lines (40 loc) · 1.28 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
<?php
/**
* @file
*
*/
function caffeinated_preprocess_html(&$vars) {
drupal_add_js('//squawk.cc/squawk.js', array('type' => 'external', 'scope' => 'footer'));
}
function caffeinated_preprocess_node(&$variables) {
// Make tags.
$items = field_get_items('node', $variables['node'], 'taxonomy_vocabulary_1');
foreach ($items as $item) {
$tags[] = field_view_value('node', $variables['node'], 'taxonomy_vocabulary_1', $item);
}
$variables['tags'] = '';
if (!empty($tags)) {
foreach ($tags as &$tag) {
$tag['#title'] = '&' . $tag['#title'];
$display_tags[] = render($tag);
}
if (!empty($display_tags)) {
$variables['tags'] = count($display_tags) ? t('In categories !tags', array('!tags' => implode(' ', $display_tags))) : '';
}
}
// Make a prettier "submitted" string.
$variables['submitted'] = t('Posted by !user on @date.', array(
'@date' => format_date($variables['created'], 'custom', 'l j F Y'),
'!user' => theme('username', array('account' => user_load($variables['node']->uid))),
));
unset($variables['content']['links']['blog']);
}
/**
* Preprocess regions.
*
function caffeinated_preprocess_region(&$variables) {
if ($variables['region'] == 'sidebar_second') {
$variables['classes_array'][] = 'well';
}
}
*/