Titans vs. Laramie County
| There was a problem with a Velocity script | |
| Page | sports/msoc/2016-17/photos/0002/photo-gallery-template |
| Error | Invocation of method 'getTaggedPlayers' in class com.prestosports.render.storage.database.DatabasePage threw exception java.lang.NullPointerException at lj2n3blex8ebyibssports/msoc/2016-17/photos/0002/photo-gallery-template[line 147, column 92] |
| Page source: |
1: ## ADD COMPONENT STYLESHEET
2: #set ($stylesheetUrl = "https://theme-assets.prestosports.com/theme-assets/generic/assets/css/photo-gallery.css")
3: $website.addCss($stylesheetUrl)
4:
5: #set ($fromHeadlines = false)
6: #if ($request.getParameter("from_headlines") == true)
7: #set ($fromHeadlines = true)
8: #end
9:
10:
11: $website.include("options")
12: #set ($options = $request.getAttribute("options"))
13:
14: ## Load sport labels for image alt text
15: #set ($sportLabels = $!request.getAttribute("sportLabels"))
16: #if (!$sportLabels || $sportLabels.size() == 0)
17: $website.includeAgain("/sport-labels")
18: #set ($sportLabels = $!request.getAttribute("sportLabels"))
19: #end
20: #set ($urlParts = $page.url.split("/"))
21: #set ($sportKey = "")
22: #set ($sportSeason = "")
23: #if ($urlParts.size() > 3 && $urlParts.get(1) == "sports")
24: #set ($sportKey = $urlParts.get(2))
25: #set ($sportSeason = $urlParts.get(3))
26: #end
27: #set ($sportLabel = "")
28: #if ($sportLabels && $sportLabels.containsKey($sportKey))
29: #set ($sportLabel = $sportLabels.get($sportKey))
30: #end
31:
32: #***********************************************
33: # MACROS
34: # *********************************************#
35: #macro (capitalize $name)
36: $name.substring(0,1).toUpperCase()$name.substring(1).toLowerCase()
37: #end
38:
39: #macro (printTitle)
40: #set ($pageTitle = "Photo Gallery")
41: #if ($page.title.trim().length() > 0)
42: #set ($pageTitle = $page.title.trim())
43: #end
44:
45: #if ($fromHeadlines || !$website.isIncluded())
46: #if($request.getAttribute("pageTitle").length() > 0)
47: #set ($pageTitle = $request.getAttribute("pageTitle"))
48: #else
49: #set ($pageTitle = "")
50: #end
51: #if ($page.title.length() > 0)
52: #set ($pageTitle = $!page.title)
53: #end
54: $!request.setAttribute("page-inc-header-title", $pageTitle)
55: $!request.setAttribute("page-inc-header-page", $page)
56: $!request.setAttribute("page-inc-header-heading-class", "page-title")
57: $website.includeAgain("page-inc-header")
58: #if($pageTitle.trim().length() == 0)
59: #set ($pageTitle = "#capitalize($page.name.trim())")
60: #end
61: $!request.setAttribute("pageTitle", "${pageTitle}")
62:
63: #if ($body.length() > 150)
64: $!request.setAttribute("pageDescription", "$body.substring(1, 150) ...")
65: #else
66: $!request.setAttribute("pageDescription", "$body")
67: #end
68: #end
69: #end
70:
71: #macro (printLeadIn)
72: #if($page.leadIn.length() > 0 && ($fromHeadlines || !$website.isIncluded()))
73: <h2 class="page-sub-title fs-5">$page.leadIn</h2>
74: #end
75: #end
76:
77: #macro (printThumbnail)
78: ## Do not use this until it is fully tested.
79: ## Thubmnails attached are designed to be used as thumbnails for gallery grids
80: ## and are not desigend to show case as a hero photo on gallery's themselves.
81: ## per Devin
82: #set ($thumbSrc = "$!{page.thumbnailURL}")
83: #set ($thumbAlt = "$!page.title")
84: #if ($page.thumbnailPage.altText.length() > 0)
85: #set ($thumbAlt = "$page.thumbnailPage.altText")
86: #end
87: #if($thumbSrc.length() > 0 )
88: <picture alt="$thumbAlt">
89: <source media="(min-width:1200px)" srcset="${thumbSrc}?max_width=1920">
90: <source media="(min-width:992px)" srcset="${thumbSrc}?max_width=1200">
91: <source media="(min-width:576px)" srcset="${thumbSrc}?max_width=992">
92: <source media="(min-width:0px)" srcset="${thumbSrc}?max_width=576">
93: <img class="img-fluid mx-auto" src="${thumbSrc}?max_width=1920" alt="${thumbAlt}"/>
94: </picture>
95: #end
96: #end
97:
98: <div class="page-content photo-gallery-content" data-page-url="$page.url">
99:
100: <div class="photo-gallery-template-heading d-flex flex-column w-100 justify-content-center align-items-stretch gap-2 mb-3">
101: #printTitle()
102: #printLeadIn()
103: </div>
104:
105: <div class="photo-gallery-template-content">
106:
107: #if ($page.contentType.equals("loki/headlines") && $headlines.size() > 0)
108:
109: #set ($instance = 0)
110: #if ($request.getAttribute("photoGalleryInstance"))
111: #set ($instance = $request.getAttribute("photoGalleryInstance"))
112: #end
113: #set ($instance = $tool.math.add($instance, 1))
114: $!request.setAttribute("photoGalleryInstance", $instance)
115: #set ($id = "photo-gallery${instance}")
116:
117: #if ($request.getParameter("id"))
118: #set ($id = $formatter.escapeXml($request.getParameter("id")))
119: #end
120:
121: <div id="${id}" class="gallery loadMore grid" itemscope itemtype="http://schema.org/ImageGallery" data-module="theme-module/cssloader" data-stylesheet-url="$stylesheetUrl">
122: #foreach ($photo in $headlines)
123:
124: #set ($storeURL = "")
125: #set ($storeURL = $website.storeURL($photo))
126: #if ($sportLabel.length() > 0 && $sportSeason.length() > 0)
127: #set ($imgAlt = "${sportLabel} ${sportSeason} - ${page.title} - image ${velocityCount}")
128: #elseif ($sportLabel.length() > 0)
129: #set ($imgAlt = "${sportLabel} - ${page.title} - image ${velocityCount}")
130: #else
131: #set ($imgAlt = "${page.title} - image ${velocityCount}")
132: #end
133: #if ($photo.altText.length() > 0)
134: #set ($imgAlt = $photo.altText)
135: #elseif( $photo.title.length() > 0 )
136: #set ($imgAlt = $photo.title)
137: #end
138:
139: <figure class="block thumbnail grid-item" itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject">
140: <div class="gal-wrapper">
141: <a href="$photo.url" data-thumb="${photo.url}?max_width=500" data-caption="$photo.title" data-width="1200" data-height="900" itemprop="contentUrl">
142: <img itemprop="thumbnail" src="/info/images/spacer.gif" alt="$imgAlt" class="masgal">
143: </a>
144: #if ($storeURL.length() > 0)
145: <button data-url="$storeURL" class="buynow-link btn btn-primary" title="View this item in photo store." aria-label="open this item in photo store">Buy Now</button>
146: #end
147: #if ($options.get("photo_gallery_hide_photo_tags") != "true" && $photo.taggedPlayers.size() > 0)
148: <ul class="tag-list clearfix">
149: #foreach ($playerBio in $photo.taggedPlayers)
150: <li><a href="$playerBio.url?view=photos" aria-label="$playerBio.firstName $playerBio.lastName: full bio">$playerBio.firstName $playerBio.lastName</a></li>
151: #end
152: </ul>
153: #end
154:
155: #if( $photo.title.length() > 0 )
156: <figcaption class="figure-caption small image-caption-overlay clamp-2">$photo.title</figcaption>
157: #end
158:
159: #if( $formatter.formatDate($photo.date, "MMM dd, yyyy").length() > 0 )
160: <span class="photo-date small">$formatter.formatDate($photo.date, "MMM dd, yyyy")</span>
161: #end
162:
163: </div>
164:
165: </figure>
166: #end
167: </div>
168:
169: $request.setAttribute("icl-photoGallery-scripts", true)
170:
171: #if ($request.getParameter("ajax") == true)
172: $website.decorate("")
173: #end
174:
175: #else ## contentType is not headlines or size equals 0
176:
177: <div>No photos featured in this gallery</div>
178:
179: #end
180: </div>
181: </div>
182:
183: <div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
184: <div class="pswp__bg"></div>
185: <div class="pswp__scroll-wrap">
186: <div class="pswp__container">
187: <div class="pswp__item"></div>
188: <div class="pswp__item"></div>
189: <div class="pswp__item"></div>
190: </div>
191: <div class="pswp__ui pswp__ui--hidden">
192: <div class="pswp__top-bar">
193: <div class="pswp__counter"></div>
194: <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>
195: <button class="pswp__button pswp__button--share" title="Share"></button>
196: <button class="pswp__button pswp__button--fs" title="Toggle full screen"></button>
197: <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>
198: <div class="pswp__preloader">
199: <div class="pswp__preloader__icn">
200: <div class="pswp__preloader__cut">
201: <div class="pswp__preloader__donut"></div>
202: </div>
203: </div>
204: </div>
205: </div>
206: <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
207: <div class="pswp__share-tooltip"></div>
208: </div>
209: <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
210: </button>
211: <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
212: </button>
213: <div class="pswp__caption">
214: <div class="pswp__caption__center text-center"></div>
215: </div>
216: </div>
217: </div>
218: </div>
|
