forked from ding2/ting_relation
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathting_relation.tpl.php
More file actions
74 lines (58 loc) · 1.38 KB
/
ting_relation.tpl.php
File metadata and controls
74 lines (58 loc) · 1.38 KB
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
<?php
/**
* @file
* Template to render ting_releation content.
*/
?>
<?php
if( empty($content) ) {
return;
}
foreach( $content as $ns => $relations ){
if (!empty($relations)) { ?>
<a name="<?php echo $ns;?>"></a>
<div class="<?php print $classes.' ting-relation-'.drupal_html_class($ns).' clearfix'; ?>">
<h2><?php echo $relations[0]['type']?></h2>
<?php foreach( $relations as $key=>$relation ) { ?>
<div class="meta">
<?php
if( isset($relation['title']) ) {
print '<h3>'.$relation['title'].'</h3>';
}
if( isset($relation['year']) ) {
print '<div>'.$relation['year'].'</div>';
}
if( isset($relation['creator']) ) {
print '<div>'.$relation['creator'].'</div>';
}
if( isset($relation['byline']) ) {
print '<div>'.$relation['byline'].'</div>';
}
if( isset($relation['isPartOf']) ) {
print $relation['isPartOf'];
}
?>
</div>
<?php
if( isset($relation['abstract']) ) {
print '<div>'.$relation['abstract'].'</div>';
}
if( isset($relation['text']) ) {
print '<div>'.$relation['text'].'</div>';
}
if( isset($relation['online_url']) ) {
print '<div class="field-type-ting-relation">';
print '<div class="field-items rounded-corners">';
print render($relation['online_url']);
print '</div></div>';
}
if( isset($relation['docbook_link']) ) {
print render($relation['docbook_link']);
}
print '<div class="clearfix"></div>';
}
} // end foreach relation
?>
</div>
<?php } // end foreach content
?>