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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
##----
## set todays date to show date ranges
##----
#set($today = $date.format('yMMdd',$date))
##----
## sets future date
##----
## Get a java Calendar
#set($x = $date.calendar)
## Add 1 year (hours=int code 1)
$x.add(1,1)
## format future date
#set($future = $date.format('yMMdd',$x))
## --------------------------------------------------
## SETTING THE DEFAULT NUMBER OF RESULTS ------------
## --------------------------------------------------
#if (!$UtilMethods.isSet($numberOfResults))
#set($numberOfResults = 100)
#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 = "+Programs.tags:$tag")
#else
#set($tagsQuery = "$tag +Programs.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
#set($myHost = $webapi.resolveHostName($request.serverName))
## --------------------------------------------------
## SETTING THE SORT ORDER ---------------------------
## --------------------------------------------------
## defaults to title if not set
#if(!$UtilMethods.isSet($sortBy))
#set($sort = "modDate")
#end
#if($UtilMethods.isSet($sortBy))
#if($sortBy.contains('tite'))
#set($sort = "tite")
#else
#set($sort = "Programs.startDate")
#end
#end
#if($pagination.contains('true'))
#set($programsListing = $dotcontent.pullPerPage("+contentType:Programs +(conhost:$host.identifier #if($systemHost.contains('true'))conhost:SYSTEM_HOST#end) #if($filterOutByDate.contains('true'))+Programs.endDate:[${today}* TO ${future}*]#end $!{catsQuery} $!{tagsQuery} ${ignoreQuery}",$!{page},$!{itemsPerPage},"$sort"))
#else
#set($programsListing = $dotcontent.pull("+contentType:Programs +(conhost:$host.identifier #if($systemHost.contains('true'))conhost:SYSTEM_HOST#end) #if($filterOutByDate.contains('true'))+Programs.endDate:[${today}* TO ${future}*]#end ",$math.toInteger($!{numberOfResults}),"$sort"))
#end
#if($UtilMethods.isSet($headline))
#if(!$UtilMethods.isSet($headlineType))
#set($headlineType = '1')
#end
<h$!{headlineType}>#if($UtilMethods.isSet($programsHomepageUrl))<a href="${programsHomepageUrl}">$!{headline}</a>#else$!{headline}#end</h$!{headlineType}>
#end
#if($programsListing.size() > 0)
<ul class="programs-list">
#foreach($program in $programsListing)
<li class="program-item">
#editContentlet($program.inode)
#if($fieldsToDisplay.contains('programImage') && $UtilMethods.isSet($program.programImage.rawUri))
<a href="/programs/$!{program.urlTitle}"><img class="program-image" src="/contentAsset/image/$!{program.identifier}/image/filter/Resize/resize_w/100" alt="$!{program.title}"></a>
#end
#if($fieldsToDisplay.contains('title') && $UtilMethods.isSet($program.urlTitle))
<h3><a href="/programs/$program.urlTitle">$program.title</a></h3>
#end
#if($fieldsToDisplay.contains('startDate') && $UtilMethods.isSet($program.startDate))
<p class="date">$date.format('E, MMMM dd, y', $program.startDate)#if($fieldsToDisplay.contains('endDate') && $UtilMethods.isSet($program.endDate)) – $date.format('E, MMMM, dd, y', $program.endDate)#end #if($fieldsToDisplay.contains('time') && $UtilMethods.isSet($program.time)) – <span class="time">$program.time</span>#end</p>
#end
#if($fieldsToDisplay.contains('location') && $UtilMethods.isSet($program.location))
<p class="location">$program.location</p>
#end
#if($fieldsToDisplay.contains('summary') && $UtilMethods.isSet($program.summary))
<p>$program.summary</p>
#end
</li>
#end
</ul>
#if($UtilMethods.isSet($programsHomepageUrl))
<p><a href="${programsHomepageUrl}">view all programs</a></p>
#end
#if($pagination.contains('true') && $programsListing.totalPages > 1)
<ul class="pagination">
#if($programsListing.previousPage)
<li><a href="/programs/?page=$!{math.sub($page, 1)}">«</a></li>
#end
#foreach($i in [1..$programsListing.totalPages])
<li #if($page == $velocityCount)class="active"#end><a href="/programs/?page=${velocityCount}">$velocityCount</a></li>
#end
#if($programsListing.nextPage)
<li><a href="/programs/?page=$!{math.add($page, 1)}">»</a></li>
#end
</ul>
#end
#else
<p>There are no programs at this time.</p>
#end