Newer
Older
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
## --------------------------------------------------
## SETTING THE DEFAULT NUMBER OF RESULTS ------------
## --------------------------------------------------
#if (!$UtilMethods.isSet($numberOfResults))
#set($numberOfResults = 20)
#end
## --------------------------------------------------
## SETTING THE SORT ORDER ---------------------------
## --------------------------------------------------
#set ($sortBy = "Person.familyName asc")
## --------------------------------------------------
## SETTING RELATIONSHIP FILTERS ---------------------
## --------------------------------------------------
#if($UtilMethods.isSet($worksFor))
#set($worksForRel = '+Works-For:')
#set($worksForID = '$worksFor')
#end
#if($UtilMethods.isSet($memberOf))
#set($memberOfRel = '+Member-Of:')
#set($memberOfID = '$memberOf')
#end
#if($UtilMethods.isSet($workLocation))
#set($workLocationRel = '+Work-Location:')
#set($workLocationID = 'workLocation')
#end
#if($UtilMethods.isSet($dataset))
#set($datasetRel = '+Dataset-Person:')
#set($datasetID = 'dataset')
#end
## --------------------------------------------------
## SETTING CATEGORIES -------------------------------
## --------------------------------------------------
#if($UtilMethods.isSet($personType))
#set($cat = "+categories:$!{personType}")
#end
#if($pagination.contains('true'))
## SETTING ITEMS PER PAGE
#if ($UtilMethods.isSet($itemsPerPage))
#set($itemsPerPage = $webapi.parseInt($itemsPerPage))
#else
#set($itemsPerPage = 20)
#end
## GETTING PAGE NUMBER
#if($UtilMethods.isSet($request.getParameter('page')))
#set($page = $webapi.parseInt($request.getParameter('page')))
#else
#set($page = 1)
#end
#set($personListing = $dotcontent.pullPerPage("
+contentType:Person
+(conhost:$host.identifier)
$!{worksForRel}$!{worksForID}
$!{memberOfRel}$!{memberOfID}
$!{workLocationRel}$!{workLocationID}
$!{datasetRel}$!{datasetID}
$!{cat}
", $!{page}, $!{itemsPerPage},"$!{sortBy}"))
#else
#set($personListing = $dotcontent.pull("
+contentType:Person
+conhost:$host.identifier)
$!{worksForRel}$!{worksForID}
$!{memberOfRel}$!{memberOfID}
$!{workLocationRel}$!{workLocationID}
$!{datasetRel}$!{datasetID}
$!{cat}
", $!{numberOfResults}, "$!{sortBy}"))
#end
<section itemscope itemtype="http://schema.org/Person">
#if($UtilMethods.isSet($headline))
#if (!$UtilMethods.isSet($headlineFontSize))
#set ($headlineFontSize = '1')
#end
<h$!{headlineFontSize} itemprop="name">$!{headline}</h$!{headlineFontSize}>
#end
#if($personListing.size() > 0)
<ul class="">
#foreach($person in $personListing)
<li class="">
#editContentlet($person.inode)
#if($UtilMethods.isSet(${person.image}))
<a class="" href="${person.urlTitle}">
<img class="" src="/contentAsset/image/$!{person.image.identifier}/fileAsset/filter/Resize/resize_w/150" alt="$person.givenName $person.familyName">
</a>
#end
#if($UtilMethods.isSet($headlineFontSize))
##if headline is set this subtracts 1 from it
#set($nameFontSize = $math.sub($!{headlineFontSize}, 1).intValue())
#else
#set($nameFontSize = '2')
#end
<h$!{nameFontSize}><a href="${person.urlTitle}" itemprop="name">$person.givenName $person.familyName</a></h$!{nameFontSize}>
#if($UtilMethods.isSet($person.jobTitle))
<p class="title" itemprop="jobTitle">$person.jobTitle</p>
#end
#if($UtilMethods.isSet($person.email))
<p class="email"><a itemprop="email" href="mailto:${person.email}">${person.email}</a></p>
#end
#if($UtilMethods.isSet($person.telephone))
<p class="phone" itemprop="telephone">$person.telephone</p>
#end
</li>
#end
</ul>
#if($pagination.contains('true') && $personListing.totalPages > 1)
<ul class="pagination">
#if($personListing.previousPage)
<li><a href="$!{folderUrl}/?page=$!{math.sub($page, 1)}">«</a></li>
#end
#foreach($i in [1..$personListing.totalPages])
<li #if($page == $velocityCount)class="active"#end><a href="$!{folderUrl}/?page=${velocityCount}">$velocityCount</a></li>
#end
#if($personListing.nextPage)
<li><a href="$!{folderUrl}/?page=$!{math.add($page, 1)}">»</a></li>
#end
</ul>
#end
#else
## insert category name, maybe make a default to staff if no categories checked...
<p>There are no $!{categories} listed at this time.</p>
#end
</section>