-
Notifications
You must be signed in to change notification settings - Fork 3
/
node--unl-newsitem.tpl.php
77 lines (68 loc) · 2.58 KB
/
node--unl-newsitem.tpl.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
<?php
/**
* @file
* unl_wdn theme implementation to display a news item node.
*/
?>
<div id="node-<?php print $node->nid; ?><?php print ($view_mode != 'full' ? '-teaser' : ''); ?>" class="<?php print $classes; ?> clearfix"<?php print $attributes; ?>>
<?php print render($title_prefix); ?>
<?php if ($view_mode != 'full'): ?>
<h4<?php print $title_attributes; ?>>
<?php if ($view_mode == 'abbr_teaser'): ?>
<?php
print render($content["field_unl_newsimg"][0]);
?>
<?php endif; ?>
<a href="<?php print $node_url; ?>"><?php print $title; ?></a>
</h4>
<?php endif; ?>
<?php print render($title_suffix); ?>
<?php if ($view_mode == 'full'): ?>
<?php print render($content["field_unl_imgcar"]); ?>
<?php endif; ?>
<?php if ($view_mode == 'full' || $view_mode == 'teaser' && $display_submitted): ?>
<div class="meta submitted">
<?php print $submitted; ?>
</div>
<?php endif; ?>
<div class="content clearfix"<?php print $content_attributes; ?>>
<?php if ($view_mode == 'full'): ?>
<div class="field field-type-image">
<div class="field-items">
<div class="field-item even primary-image">
<?php
$content["field_unl_newsimg"][0]["#image_style"] = 'large';
$content["field_unl_newsimg"][0]["#item"]["attributes"]["class"] = array('frame');
print render($content["field_unl_newsimg"][0]);
?>
<?php if ($page && !empty($content["field_unl_newsimg"][0]["#item"]["title"])): ?>
<p class="caption">
<?php print $content["field_unl_newsimg"][0]["#item"]["title"]; ?>
</p>
<?php endif; ?>
</div>
</div>
</div>
<?php endif; ?>
<?php
// We hide the comments and links now so that we can render them later.
hide($content['comments']);
hide($content['links']);
// If more than one image is available, show the addtional images
if ($view_mode == 'full') {
foreach (array_diff(array_keys($content), array('field_unl_imgcar', 'field_unl_newsimg', 'links', 'comments')) as $field) {
print render($content[$field]);
}
if (isset($content["field_unl_newsimg"][1])) {
unset($content["field_unl_newsimg"][0]);
print render($content["field_unl_newsimg"]);
}
} else if ($view_mode == 'teaser') {
print render($content["field_unl_newsimg"]);
print render($content["body"]);
}
?>
</div>
<?php print render($content['links']); ?>
<?php print render($content['comments']); ?>
</div>