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
## --------------------------------------------------
## SETTING THE DEFAULT NUMBER OF RESULTS ------------
## --------------------------------------------------
#if (!$UtilMethods.isSet($numberOfResults))
#set($numberOfResults = 5)
#end
## --------------------------------------------------
## SETTING THE SORT ORDER ---------------------------
## --------------------------------------------------
#set ($sortBy = "modDate desc")
#if ($sortResultsBy == "Name")
#set ($sortBy = "Employee.lastName $sortOrder1")
#elseif ($sortResultsBy == "date")
#set ($sortBy = "modDate $sortOrder1")
#end
## --------------------------------------------------
## FILTER BY CATEGORIES -----------------------------
## --------------------------------------------------
#set($catsQuery = "")
#foreach ($catInode in $topic)
#if ($velocityCount == 1)
#set($catsQuery = "categories:$categories.getCategoryByInode($catInode).categoryVelocityVarName")
#else
#set($catsQuery = "$catsQuery categories:$categories.getCategoryByInode($catInode).categoryVelocityVarName")
#end
#end
#if ($UtilMethods.isSet($catsQuery))
#set($catsQuery = "+($catsQuery)")
#end
#set($ignoreQuery="")
#if($UtilMethods.isSet($URLMapContent.inode))
#set($ignoreQuery="-inode:$URLMapContent.inode")
#end
## --------------------------------------------------
## FILTERS BY TAGS ----------------------------------
## --------------------------------------------------
#set($tagsQuery = "")
#if ($UtilMethods.isSet($tagsFilter))
#foreach ($tag in $tagsFilter.split(','))
#if ($velocityCount == 1)
#set($tagsQuery = "+Employee.tags:$tag")
#else
#set($tagsQuery = "$tag +Employee.tags:$tag")
#end
#end
#end
## --------------------------------------------------
## SETTING PAGINATED RESULTS ------------------------
## --------------------------------------------------
#if($pagination.contains('true'))
## SETTING ITEMS PER PAGE
#if ($UtilMethods.isSet($itemsPerPage))
#set($itemsPerPage = $webapi.parseInt($itemsPerPage))
#else
#set($itemsPerPage = 5)
#end
## GETTING PAGE NUMBER
#if($UtilMethods.isSet($request.getParameter('page')))
#set($page = $webapi.parseInt($request.getParameter('page')))
#else
#set($page = 1)
#end
#end
#if($pagination.contains('true'))
#set($employeesListing = $dotcontent.pullPerPage("+structureName:Employee +(conhost:$host.identifier) $!{catsQuery} $!{tagsQuery} ${ignoreQuery}",$math.toInteger(${page}),$math.toInteger(${itemsPerPage}),"$!{sortBy}"))
#else
#set($employeesListing = $dotcontent.pull("+structureName:Employee +(conhost:$host.identifier) $!{catsQuery} $!{tagsQuery} ${ignoreQuery}",$math.toInteger(${numberOfResults}),"$!{sortBy}"))
#end
#if ($UtilMethods.isSet($headline))
#if (!$UtilMethods.isSet($headlineType))
#set ($headlineType = '1')
#end
<h$!{headlineType} class="employees-listing-headline">$!{headline}</h$!{headlineType}>
#end
#if($employeesListing.size() > 0)
<ul class="employees-list faculty">
#foreach ($employeesItem in $employeesListing)
<li class="employees-item faculty-person">
#editContentlet($employeesItem.inode)
<p class="name">
#if ($fieldsToDisplay.contains('image') && $UtilMethods.isSet($employeesItem.photo.rawUri))
<a href="$!{folderUrl}/$!{employeesItem.urlTitle}">
<img class="employees-image faculty-thumb" src="/contentAsset/image/$!{employeesItem.identifier}/photo/filter/Resize/resize_w/100" alt="$employeesItem.firstName $employeesItem.lastName">
</a>
#end
<a href="$!{folderUrl}/$!{employeesItem.urlTitle}">$employeesItem.firstName $employeesItem.lastName</a>
#if($fieldsToDisplay.contains('position') && $UtilMethods.isSet($employeesItem.position))
<br><span class="position">$employeesItem.position</span>
#end
</p>
#if ($fieldsToDisplay.contains('summary') && $UtilMethods.isSet($employeesItem.summary))
<p class="summary">$!{employeesItem.summary}</p>
#end
</li>
#end
</ul>
#if($pagination.contains('true') && $employeesListing.totalPages > 1)
<ul class="pagination">
#if($employeesListing.previousPage)
<li><a href="$!{folderUrl}/?page=$!{math.sub($page, 1)}">«</a></li>
#end
#foreach($i in [1..$employeesListing.totalPages])
<li #if($page == $velocityCount)class="active"#end><a href="$!{folderUrl}/?page=${velocityCount}">$velocityCount</a></li>
#end
#if($employeesListing.nextPage)
<li><a href="$!{folderUrl}/?page=$!{math.add($page, 1)}">»</a></li>
#end
</ul>
#end
#else
<p>There are no employees stories at this time.</p>
#end