2017 UW-Oshkosh Men's Cross Country Roster

There was a problem with a Velocity script
Pageroster-headline-template
ErrorInvocation of method 'sortedBy' in class com.prestosports.content.HeadlinesSorter threw exception Only one : should be in a sort rule (first_name: :last_name) at roster-headline-template[line 195, column 37]
Page source:
1: $website.include("options")
2: #set ($options = $request.getAttribute("options"))
3: 
4: #macro (printPlayerAriaLabel $bioinfo)
5:     #set ($bio = $bioinfo.getDataAsObject().getAttributes())
6:     #if ($bio.get("full_name").length() > 0)
7:         #set ($fullName = $bio.get("full_name"))
8:     #else
9:         #set ($firstName = $bio.get("first_name"))
10:         #set ($lastName = $bio.get("last_name"))
11:         #set ($fullName = "${firstName} ${lastName}")
12:     #end
13:     #if ($bio.get("number").length() > 0)
14:         #set ($jerseyNumber = "jersey number ${bio.get('number')}")
15:     #end
16:     aria-label="${fullName}: ${jerseyNumber}: full bio"
17: #end
18: 
19: #macro (printHeadshot $bioinfo)
20: 	#set ($bio = $bioinfo.getDataAsObject().getAttributes())
21: 	#set ($alt = "${bio.get('first_name')} ${bio.get('last_name')} full bio")
22: 	
23:     #if ($bioinfo.publishedHeadshots.size() > 0)
24:     	#set ($src = $bioinfo.publishedHeadshots.get(0).url)
25:     #else
26:     	#if ($website.exists("/images/setup/headshot_default.jpg"))
27: 			#set ($src = "/images/setup/headshot_default.jpg")
28:     	#else
29: 			#set ($src = "/info/images/default_headshot.jpg")
30:     	#end
31: 	#end
32: 	
33: 	<img src="/info/images/spacer.gif" data-src="${src}?max_width=300" alt="$alt" class="headshot lazyload" />
34: #end ## macro printHeadshot
35: 
36: #set ($rosterLayout = "list")
37: #set ($showHeadshotView = false)
38: 
39: #if ($options.get("roster_show_headshot_view") == true && !($browser.getIphone() || $browser.getMobile()))
40: 	#set ($showHeadshotView = true)
41: 	
42:     #foreach ($cookie in $request.cookies)
43:         #if ($cookie.name == "roster_view")
44:         	#set ($rosterLayout = $cookie.value)
45:         #end
46: 	#end	
47: #end
48: 
49: #if ($options.get("roster_default_view"))
50:   #set ($rosterLayout = $options.get("roster_default_view"))
51: #end
52: 
53: #if ($request.getParameter("view"))
54:   #set ($view = $request.getParameter("view"))
55:   #if ($view == "list" || $view == "headshot")
56:     #set ($rosterLayout = $view)
57:   #end
58: #end
59: 
60: #if ($request.getParameter("sort").length() > 0) ## when sort param is available, force the list layout
61:   #set ($rosterLayout = "list")
62: #end
63: 	
64: <div class="mod-roster" data-module="roster-layout" data-page-title="$!page.title - ${website.profile.siteName}">
65: 
66: #if ($options.get("archive_roster"))
67: 	#set ($archiveRosterString = $options.get("archive_roster"))
68: 	#set ($archiveRosterString = $archiveRosterString.split(","))
69: 	#set ($isArchivePage = false)
70: 	#if ($tool.list.size($archiveRosterString) > 0)
71: 		<div class="roster-archive clearfix">
72: 		<select aria-label="Change the season by selecting an option from the list below">
73: 			<option selected="selected">Archive Rosters</option>
74: 			#foreach ($string in $archiveRosterString)
75: 				#set ($archiveRoster = $string.split(":"))
76: 				#if ($tool.list.size($archiveRoster) == 2)
77: 					#set ($archiveUrl = $tool.list.get($archiveRoster, 0).trim())
78: 					#set ($archiveLabel = $tool.list.get($archiveRoster, 1).trim())
79: 					#if ($archiveUrl != $page.url)
80: 						<option value="$archiveUrl">$archiveLabel</option>
81: 					#else
82: 						#set ($isArchivePage = true)
83: 					#end
84: 				#end
85: 			#end
86: 		</select>
87: 		</div>
88: 	#end
89: #end
90: 
91: <div class="align-center">
92: 	#if ($page.thumbnailURL)
93: 		#set ($rosterThumbSize = 600)
94:         #if ($tool.math.toInteger($options.get("roster_thumb_size")))
95:           #set ($rosterThumbSize = $tool.math.toInteger($options.get("roster_thumb_size")))
96:         #end
97: 		<div class="banner-img">
98: 			<img src="$page.thumbnailURL?max_width=${rosterThumbSize}" alt="page.thumbnailPage.altText" width="${rosterThumbSize}" />
99: 		</div>
100: 	#end
101: 	#if ($showHeadshotView)
102:     <div class="toggle-buttons">
103:       <ul class="clearfix">
104:         <li #if ($rosterLayout == "list") class="list active" #else class="list" #end>
105: 			<a href="${page.url}?view=list" class="btn" role="button" #if ($rosterLayout == "list") aria-pressed="true" #end>
106: 				<span class="icon gicon-menu"></span><span class="text">List View</span>
107: 			</a>
108: 		</li>
109:         <li #if ($rosterLayout == "headshot") class="headshot active" #else class="headshot" #end>
110: 			<a href="${page.url}?view=headshot" class="btn" role="button" #if ($rosterLayout == "headshot") aria-pressed="true" #end>
111: 				<span class="icon gicon-headshot"></span><span class="text">Headshot View</span>
112: 			</a>
113: 		</li>
114:       </ul>
115:     </div>
116: 	#end
117: 	#if ($page.title.length() > 0)
118: 		<h1>$page.title</h1>
119: 	#end
120: </div>
121: 
122: #if ($rosterLayout == "list")
123: 	#macro (printFieldValue $field $defaultValue)
124:     	#set ($fieldValue = "")
125:     	#if ($field.contains(">"))
126:     		#set ($orderedFields = $field.split(">"))
127:     		#foreach ($orderedField in $orderedFields)
128:     			#set ($orderedField = $orderedField.trim())
129:     			#if ($bio.get($orderedField) && $fieldValue.length() == 0)
130:     				#set ($fieldValue = $bio.get($orderedField))
131:     			#end
132:     		#end
133:     	#else
134:     		#if ($bio.get($field))
135:     			#set ($fieldValue = $bio.get($field))
136:     		#end
137: 		#end
138: 		#if ($fieldValue.length() > 0)
139: 			$fieldValue
140: 		#else
141: 			$defaultValue
142: 		#end
143:     #end
144:     
145:     #macro (printField $field)
146:     	#set ($splitter = "")
147:     	#if ($field.contains(": :")) ## multipart fields separated by a space
148:     		#set ($splitter = ": :")
149:     	#elseif ($field.contains(":/:")) ## multipart fields separated by a /
150:     		#set ($splitter = ":/:")
151:     	#end
152:       
153:     	#if ($splitter.length() > 0)
154:     		#set ($multipartField = $field.split($splitter))
155:     		#foreach ($fieldPart in $multipartField)
156:     			#set ($fieldPart = $fieldPart.trim())
157:     			#if ($velocityCount > 1)
158:     				$splitter.charAt(1)
159:     			#end
160:     			#printFieldValue($fieldPart "-")
161:     		#end
162:     	#else
163:     		#printFieldValue($field "&nbsp;")
164:     	#end
165: 	#end
166: 	
167: 	#set ($rosterFields = ["number","first_name: :last_name","position","year","height","weight","hometown:/:highschool"])
168: 	#set ($rosterLabels = ["No.","Name","Pos.","Cl.","Ht.","Wt.","Hometown/High School"])
169: 	#set ($rosterSortables = ["number","last_name","year","position"])
170: 	
171: 	#if ($options.get("roster_fields") && $options.get("roster_labels"))
172:         #set ($rosterFieldsString = $options.get("roster_fields"))
173:         #set ($rosterLabelsString = $options.get("roster_labels"))
174:         
175: 		#set ($rosterFieldsString = $rosterFieldsString.split(","))
176:         #set ($rosterLabelsString = $rosterLabelsString.split(","))
177: 		
178: 		#set ($rosterFieldsSize = $tool.list.size($rosterFieldsString))
179: 		#set ($rosterLabelsSize = $tool.list.size($rosterLabelsString))
180: 
181: 		#if ($rosterFieldsSize > 0 && $rosterLabelsSize > 0 && $rosterFieldsSize == $rosterLabelsSize)
182: 			#set ($rosterFields = $rosterFieldsString)
183: 			#set ($rosterLabels = $rosterLabelsString)
184: 		#end
185: 	#end
186: 	
187: 	#if ($options.get("roster_sortable"))
188: 		#set ($rosterSortablesString = $options.get("roster_sortable"))
189: 		#set ($rosterSortables = $rosterSortablesString.split(","))
190: 	#end
191:     
192:     #set ($sortBy = "")
193:     #set($sortBy = $formatter.escapeXml($request.getParameter("sort")))
194:     #if ($sortBy.length() > 0)
195:       #set ($headlines = $headlines.sortedBy($sortBy))
196:     #end
197:     
198:     <div class="roster">
199:     	<table>
200:     		<thead>
201:     			<tr class="roster-header accent-bg">
202:     				##PRINTING LABELS
203:     				#foreach($field in $rosterFields)
204:     					#set ($fieldLabel = $tool.list.get($rosterLabels, $tool.math.sub($velocityCount, 1)))
205:     					#set ($isSortable = false)
206:     					#set ($sortableField = "")
207:     					
208:     					#if ($tool.list.size($rosterSortables) > 0)
209:     						#foreach ($sortable in $rosterSortables)
210:     							#if ($field.contains($sortable))
211:     								#set ($isSortable = true)
212:     								#set ($sortableField = $sortable)
213:     							#end
214:     						#end
215: 						#end
216: 						
217: 						#set ($ariaLabelColumn = $sortableField)
218: 						#if ($sortableField.contains('custom'))
219: 							#set ($ariaLabelColumn = $fieldLabel)
220: 						#end
221:     					
222:     					<th scope="col" class="col${velocityCount}">
223:     						#if ($isSortable)
224:     							<button value="$page.url?sort=${sortableField}" title="Sort using this column" class="sortable" role="button" aria-label="sort table using ${ariaLabelColumn}: column">$fieldLabel</button>
225:     						#else
226:     							$fieldLabel
227:     						#end
228:     					</th>
229:     				#end
230:     			</tr>
231:     		</thead>
232:     		<tbody>
233:     			#foreach ($bioinfo in $headlines)
234:     				#set ($bio = $bioinfo.getDataAsObject().getAttributes())
235:     				<tr>
236:     					#foreach($field in $rosterFields)
237: 							#set ($dataLabel = $tool.list.get($rosterLabels, $tool.math.sub($velocityCount, 1)))
238: 							#if ($field.contains("first_name") || $field.contains("last_name") || $field.contains("full_name")) 
239: 								<th scope="row" class="name">
240: 									<a #printPlayerAriaLabel($bioinfo) href="$bioinfo.url">#printHeadshot($bioinfo) #printField($field)</a>
241: 								</th>
242: 							#else								
243: 								<td #if ($field.equals("number")) class="number" #end>
244: 									<span class="label">$dataLabel:</span>
245: 									#if ($field.contains("email_address"))
246: 										<a href="mailto:${bio.get("email_address")}">#printField($field)</a>
247: 									#else
248: 										#printField($field)
249: 									#end
250: 								</td>
251: 							#end
252:     					#end
253:     				</tr>
254:     			#end
255:     		</tbody>
256:     	</table>
257:     </div>
258: #elseif ($rosterLayout == "headshot")
259: 	
260: 	#set ($headshotSize = "medium")
261: 	#if ($options.get("roster_headshot_size"))
262:       #set ($headshotSize = $options.get("roster_headshot_size"))
263:     #end
264: 	
265: 	<div class="roster headshot-layout ${headshotSize}">
266:     <ul class="clearfix">
267:     	#foreach ($bioinfo in $headlines)
268: 			#set ($bio = $bioinfo.getDataAsObject().getAttributes())
269: 			<li class="player">
270: 				<a #printPlayerAriaLabel($bioinfo) href="$bioinfo.url">
271: 					#printHeadshot($bioinfo)
272:     		        #if ($bio.get("number") && $!bio.get("number").length() > 0)<span class="number">$bio.get("number")</span>#end
273:     		        #if ($bio.get("first_name") && $bio.get("last_name"))<span class="name"><span class="firstname">$bio.get("first_name")</span> <span class="lastname">$bio.get("last_name")</span></span>#end
274: 				</a>
275: 			</li>
276:     	#end ## outer-loop
277:     </ul>
278: 	</div>
279: #end ## roster-layout
280: 
281: #set ($rosterFooter = "${page.url}-footer")
282: 
283: #if ($website.exists($rosterFooter))
284:   <div class="roster-footer">$website.include($rosterFooter)</div>
285: #end
286: 
287: </div> ## mod-roster