Inside the Tollway
An error occurred while processing the template.
?substring(...) argument #2 had invalid value: The index must be at least 0, but was -1. ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign urlConstructionFirstPart = vi... [in template "20157#20197#765210" at line 210, column 57] ----
1<style>
2 img {
3 max-width: 100%;
4 width: auto\9;
5 height: auto;
6 vertical-align: middle;
7 border: 0;
8 -ms-interpolation-mode: bicubic;
9 }
10
11 .image-large{
12 width: 100%
13 }
14
15 .image-medium{
16 padding-top: 10px;
17 max-height: 100%;
18 }
19
20 .image-small{
21 display: block;
22 width: 100%;
23 height: 0px;
24 background-size: cover;
25 background-position: center;
26 background-repeat: no-repeat;
27 padding-bottom:100%;
28 }
29
30 .separator {
31 border-top: 1px dotted #bfbfbf !important;
32 }
33
34 /* Avoid buttons being croped in small devices*/
35 .taglib-page-iterator .lfr-pagination-buttons>li>a{
36 width: auto !important;
37 }
38
39 @media screen and (max-width: 750px) {
40 .navbar-search.pull-right{
41 max-width: 100%;
42 }
43 }
44
45 @media screen and (max-width: 979px){
46 .form-search .btn[type="submit"]{
47 display: block !important;
48 position: inherit !important;
49 margin-top: 10px !important;
50
51 -webkit-border-radius: 14px 14px 14px 14px !important;
52 -moz-border-radius: 14px 14px 14px 14px !important;
53 border-radius: 14px 14px 14px 14px !important;
54 }
55
56 .navbar-search.pull-right{
57 max-width: 90%;
58 }
59 }
60
61 .portlet-blogs .entry-content {
62 margin-bottom: 0px;
63 }
64 .portlet-blogs .entry-body p {
65 line-height: 18px;
66 margin-bottom: 10px;
67 }
68
69 .portlet-blogs .entry-date {
70 color: #999;
71 }
72 .portlet-blogs .entry-footer:after {
73 display: inline;
74 content: initial;
75 }
76
77 .pagination-bar {
78 align-items: center;
79 display: flex;
80 flex-wrap: wrap;
81 clear: both;
82 height: auto;
83 width: auto;
84 }
85
86 .portlet-blogs .pagination-bar .pagination .page-item .page-link{
87 color: #009c34;
88 }
89 .portlet-blogs .pagination-bar .pagination .page-item .page-link:hover {
90 color: #0B3D16;
91 text-decoration: none;
92 }
93 .portlet-blogs .pagination-bar .pagination .page-item .page-link:focus {
94 box-shadow: 0 0 0 0.2rem #28a7453d;
95 }
96 .portlet-blogs .pagination-bar .pagination .page-item.disabled .page-link {
97 color: #6c757d;
98 }
99 .page-link:active, .page-link.active, .nav-underline .tab.active a.page-link {
100 background-color: #009c34;
101 border-color: #009c34;
102 }
103 .portlet-blogs .entry-title h2 {
104 margin-right: 0px;
105 }
106 .page-item.active .page-link, .nav-underline .tab.active a.page-item .page-link, .page-item.show .page-link {
107 background-color: #009c34;
108 border-color: #009c34;
109 color: #FFF !important;
110 cursor: default;
111 z-index: 3;
112 }
113 .twitter-share-button.twitter-share-button-rendered.twitter-tweet-button {
114 width: initial !important;
115 }
116
117</style>
118
119<#-- Import facebook button script -->
120<div id="fb-root"></div>
121<script async defer src="https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v3.2"></script>
122
123<#assign dlFileEntryUtil = serviceLocator.findService("com.liferay.document.library.kernel.service.DLFileEntryLocalService") >
124
125<#assign liferay_ui = taglibLiferayHash["/META-INF/liferay-ui.tld"] />
126
127<#assign homeURL = currentURL?substring(0, currentURL?index_of("?")) />
128<#assign thisEntryId = "entryId">
129
130<#-- loads all blog entries -->
131<#assign BlogsEntryLocalServiceImpl = serviceLocator.findService("com.liferay.blogs.service.BlogsEntryLocalService")>
132<#assign queryDefinition = objectUtil("com.liferay.portal.kernel.dao.orm.QueryDefinition")>
133${queryDefinition.setStatus(getterUtil.getInteger(0))}
134<#assign totalentries = BlogsEntryLocalServiceImpl.getGroupEntries(themeDisplay.getLayout().getGroupId(),queryDefinition)>
135
136<#-- Check if this is an entry's details page and if true, get the entry's id -->
137<#assign isDetailsPage = false />
138<#if (currentURL?index_of(thisEntryId) > -1)>
139 <#assign currentEntryId = currentURL?substring(currentURL?index_of(thisEntryId) + thisEntryId?length) />
140 <#assign currentEntryId = currentEntryId?substring(0, currentEntryId?index_of(thisEntryId)) />
141 <#if currentEntryId?has_content>
142 <#assign currentEntryId = currentEntryId?number />
143 <#assign isDetailsPage = true />
144 </#if>
145
146 <#elseif (themeDisplay.getURLCurrent()?index_of(thisEntryId) > -1) >
147 <#assign currentEntryId = themeDisplay.getURLCurrent()?substring(themeDisplay.getURLCurrent()?index_of(thisEntryId) + thisEntryId?length) />
148 <#assign currentEntryId = currentEntryId?substring(0, currentEntryId?index_of(thisEntryId)) />
149 <#if currentEntryId?has_content>
150 <#assign currentEntryId = currentEntryId?number />
151 <#assign isDetailsPage = true />
152 </#if>
153
154</#if>
155
156<#function getSmallImageUrl entry>
157 <#assign smallImageID = entry.getSmallImageFileEntryId() />
158
159 <#if (validator.isNull(smallImageID))>
160 <#assign smallImageURL = entry.getSmallImageURL() />
161 <#else>
162 <#assign dlFileEntry = dlFileEntryUtil.getFileEntry(smallImageID) />
163 <#assign smallImageURL = "/documents/${dlFileEntry.getRepositoryId()}/${dlFileEntry.getFolderId()}/${dlFileEntry.getTitle()}" />
164 </#if>
165
166 <#return smallImageURL>
167</#function>
168
169<#function getCoverImageUrl entry>
170 <#assign coverImageID = entry.getCoverImageFileEntryId() />
171
172 <#if (validator.isNull(coverImageID))>
173 <#assign coverImageURL = entry.getCoverImageURL() />
174 <#else>
175 <#assign dlFileEntry = dlFileEntryUtil.getFileEntry(coverImageID) />
176 <#assign coverImageURL = "/documents/${dlFileEntry.getRepositoryId()}/${dlFileEntry.getFolderId()}/${dlFileEntry.getTitle()}" />
177 </#if>
178
179 <#return coverImageURL>
180</#function>
181
182
183<div class="col-md-9 col-sm-12" style="padding= 0px;">
184
185 <#-- Post's Details Page -->
186 <#if isDetailsPage>
187
188 <#-- Hide the pagination and search bar on the details page -->
189 <#list totalentries as entry>
190 <#if entry.getEntryId() == currentEntryId>
191 <div class="entry blogDetailsPage">
192 <script>FB.init({
193 status : true,
194 xfbml : true,
195 version : 'v3.2'
196 });</script>
197 <#assign viewURL = renderResponse.createRenderURL() />
198 <#assign viewURL2 = renderResponse.createRenderURL() />
199 ${viewURL.setParameter("struts_action", "/blogs/view")}
200 ${viewURL.setParameter("redirect", currentURL)}
201 ${viewURL.setParameter("urlTitle", entry.getUrlTitle() + thisEntryId + entry.getEntryId() + thisEntryId)}
202 ${viewURL2.setParameter("urlTitle", entry.getUrlTitle() + thisEntryId + entry.getEntryId() + thisEntryId)}
203 <#assign detailsUrl = "${currentURL}${thisEntryId}${entry.getEntryId()}${thisEntryId}" />
204 <#if (isDetailsPage == true && detailsUrl?index_of('p_p_id=') > -1 && detailsUrl?index_of('cur=') > -1 )>
205 <#assign blogNameSpace = detailsUrl?substring(detailsUrl?index_of('p_p_id=') + 'p_p_id='?length, detailsUrl?index_of('&p_p_lifecycle=') ) />
206 <#assign currentPagination = detailsUrl?substring(detailsUrl?index_of('cur=') + 'cur='?length) />
207 <#assign currentPagination = currentPagination?substring(0, currentPagination?index_of('&')) />
208 <#assign currentPagination = currentPagination?number />
209 <#if (currentPagination > 1)>
210 <#assign urlConstructionFirstPart = viewURL?substring(0 , viewURL?index_of('Dtrue') ) + 'Dtrue' />
211 <#assign urlTitleCheck = entry.getUrlTitle() + thisEntryId + entry.getEntryId() + thisEntryId />
212 <#assign pageURL = themeDisplay.getURLPortal() + themeDisplay.getURLCurrent() />
213 <#if (pageURL?index_of(urlTitleCheck) > -1) >
214 <#assign viewURL2 = pageURL />
215 <#else>
216 <#assign urlConstructionSecondPart = "&_"+ blogNameSpace+"_" + viewURL?substring(viewURL?index_of('urlTitle') ) />
217 <#assign viewURL2 = urlConstructionFirstPart + urlConstructionSecondPart +"&_"+ blogNameSpace+"_cur="+currentPagination />
218 </#if>
219
220 </#if>
221 </#if>
222
223 <div class="col-md-12 col-sm-12">
224 <div class="entry-body">
225
226 <div class="entry-content" style="padding-bottom: 20px;">
227 <div class="entry-title">
228 <h3 style="padding-bottom: 0px;">
229 <a href="javascript:location.reload();" style="color: #009c34">${htmlUtil.escape(entry.getTitle())}</a>
230 </h3>
231 </div>
232 <span class="entry-date">
233 <@liferay_ui["icon"] image="date" />
234 ${dateUtil.getDate(entry.getDisplayDate(), "dd MMM yyyy", locale)}
235 </span>
236 </div>
237
238 <div>
239 <div class="col-md-1 col-sm-12" style="padding-left: 0px; padding-bottom: 5px;">
240 <a class="fb-like" data-href="${viewURL2}/${entry.getUrlTitle()}" data-layout="button_count" data-action="like" data-size="small" data-show-faces="false" data-share="false"></a>
241 </div>
242
243 <div class="col-md-2 col-sm-12" style="padding-left: 0px; padding-bottom: 5px;">
244 <a href="http://twitter.com/share" class="twitter-share-button"
245 data-url="${viewURL2}"
246 data-text="${entry.getUrlTitle()}">
247 Tweet
248 </a>
249 </div>
250 </div>
251
252 <div style="padding-bottom: 30px;">
253 <#assign coverImageURL = getCoverImageUrl(entry)/>
254
255 <img class="image-large" src= "${coverImageURL}" onerror="this.style.display='none'" alt=" "/>
256 </div>
257
258
259 <div style="padding-bottom: 25px;">
260 <p>
261 ${entry.getContent()}
262 </p>
263 </div>
264 <p style="padding-bottom: 25px;">
265 <a href="${homeURL}">Back to Inside the Tollway »</a>
266 </p>
267 </div>
268 </div>
269 </div>
270 <script>
271 $('head').prepend(' <meta property="og:image" content="${coverImageURL}"/> ');
272 </script>
273 <#assign description = entry.getDescription() />
274 <#assign videoBlogEntryAssociationKey = "<VideoToAssociate=" />
275 <#if (!validator.isNull(description))>
276 <#list description?split(">") as sValue>
277 <#if (sValue?trim?starts_with(videoBlogEntryAssociationKey))>
278 <script>
279 $('head').prepend(' <meta property="og:video" content="${sValue?substring(sValue?index_of('=') + 1)}" /> ');
280 </script>
281 </#if>
282 </#list>
283 </#if>
284 <#break>
285 </#if>
286 </#list>
287 <#else>
288 <#-- Main page -->
289 <#list entries as entry>
290
291 <#-- First Post -->
292 <#if (entry_index == 0)>
293 <div class="col-md-12 col-sm-12 entry">
294 <script>FB.init({
295 status : true,
296 xfbml : true,
297 version : 'v3.2'
298 });</script>
299 <#assign viewURL = renderResponse.createRenderURL() />
300 <#assign viewURL2 = renderResponse.createRenderURL() />
301 ${viewURL.setParameter("struts_action", "/blogs/view")}
302 ${viewURL.setParameter("redirect", currentURL)}
303 ${viewURL.setParameter("urlTitle", entry.getUrlTitle() + thisEntryId + entry.getEntryId() + thisEntryId)}
304 ${viewURL2.setParameter("urlTitle", entry.getUrlTitle() + thisEntryId + entry.getEntryId() + thisEntryId)}
305 <#assign detailsUrl = viewURL />
306
307 <#-- Build the url to the posts details page -->
308 <#if isDetailsPage == true>
309 <#assign detailsUrl = "${currentURL}${thisEntryId}${entry.getEntryId()}${thisEntryId}" />
310 </#if>
311 <#if (isDetailsPage == true && detailsUrl?index_of('p_p_id=') > -1 && detailsUrl?index_of('cur=') > -1 )>
312 <#assign blogNameSpace = detailsUrl?substring(detailsUrl?index_of('p_p_id=') + 'p_p_id='?length, detailsUrl?index_of('&p_p_lifecycle=') ) />
313 <#assign currentPagination = detailsUrl?substring(detailsUrl?index_of('cur=') + 'cur='?length) />
314 <#assign currentPagination = currentPagination?substring(0, currentPagination?index_of('&')) />
315 <#assign currentPagination = currentPagination?number />
316 <#if (currentPagination > 1)>
317 <#assign currentPaginationNamespace = "&_"+ blogNameSpace+"_cur="+currentPagination />
318 <#assign viewURL2 = viewURL+"&_"+ blogNameSpace+"_cur="+currentPagination />
319 </#if>
320 </#if>
321 <div class="entry-body">
322 <div>
323 <#assign coverImageURL = getCoverImageUrl(entry)/>
324
325 <img class="image-large" src= "${coverImageURL}" onerror="this.style.display='none'" alt=" "/>
326 </div>
327
328 <div class="entry-content" style="padding-top: 20px;">
329 <div class="entry-title">
330 <h3><a href="${detailsUrl}" style="color: #009c34">${htmlUtil.escape(entry.getTitle())}</a></h2>
331 </div>
332 </div>
333
334 <p>
335 <#assign description = entry.getDescription() />
336 <#assign heroStoryWordsWidthKey = "<HeroStoryWordsWidth=" />
337 <#assign heroStoryWordsWidthAssociated = false />
338 <#if (!validator.isNull(description))>
339 <#list description?split(">") as sValue>
340 <#if (sValue?trim?starts_with(heroStoryWordsWidthKey))>
341 ${stringUtil.shorten(htmlUtil.stripHtml(entry.getContent()), sValue?substring(sValue?index_of('=') + 1)?number)}
342 <#assign heroStoryWordsWidthAssociated = true />
343 </#if>
344 </#list>
345 <#if (!heroStoryWordsWidthAssociated)>
346 ${stringUtil.shorten(htmlUtil.stripHtml(entry.getContent()), 2000)}
347 </#if>
348 <#else>
349 ${stringUtil.shorten(htmlUtil.stripHtml(entry.getContent()), 2000)}
350 </#if>
351 </p>
352 <div style="padding-top: 15px;">
353 <div class="col-md-4 col-sm-12" style="padding: 0px;">
354 <a class="read-more" href="${detailsUrl}" entrytitle="${entry.getUrlTitle()}">
355 Read full article<span class="hide-accessible"><@liferay.language key="about"/>${htmlUtil.escape(entry.getTitle())}</span> »
356 </a>
357 </div>
358
359 <div class="col-md-8 col-sm-12" style="padding: 0px;">
360 <div class="col-md-2 col-sm-12 col-xs-3" style="padding-left: 0px; float: right; margin-right: -30px;">
361 <a href="http://twitter.com/share" class="twitter-share-button"
362 data-url="${viewURL2}"
363 data-text="${entry.getUrlTitle()}">
364 Tweet
365 </a>
366 </div>
367 <div class="col-md-1 col-sm-12 col-xs-3" style="padding-left: 0px; float: right; margin-right: 25px;">
368 <a class="fb-like" data-href="${viewURL2}/${entry.getUrlTitle()}" data-layout="button_count" data-action="like" data-size="small" data-show-faces="false" data-share="false"></a>
369 </div>
370 </div>
371
372 </div>
373 </div>
374
375 <div class="entry-footer" style="padding-top: 10px;">
376
377
378
379
380
381 <span class="entry-date">
382 <@liferay_ui["icon"] image="date" />
383 ${dateUtil.getDate(entry.getDisplayDate(), "dd MMM yyyy", locale)}
384 </span>
385
386 <#assign blogsEntryClassName = "com.liferay.blogs.model.BlogsEntry" />
387
388 <span class="entry-categories">
389 <@liferay_ui["asset-categories-summary"]
390 className=blogsEntryClassName
391 classPK=entry.getEntryId()
392 portletURL=renderResponse.createRenderURL()
393 />
394 </span>
395
396 <span class="entry-tags">
397 <@liferay_ui["asset-tags-summary"]
398 className=blogsEntryClassName
399 classPK=entry.getEntryId()
400 portletURL=renderResponse.createRenderURL()
401 />
402 </span>
403 </div>
404 </div>
405
406 <#-- List of Posts -->
407 <#else>
408
409 <div class="col-md-12 col-sm-12 entry">
410 <#assign viewURL = renderResponse.createRenderURL() />
411
412 ${viewURL.setParameter("struts_action", "/blogs/view")}
413 ${viewURL.setParameter("redirect", currentURL)}
414 ${viewURL.setParameter("urlTitle", entry.getUrlTitle() + thisEntryId + entry.getEntryId() + thisEntryId)}
415
416 <#assign detailsUrl = viewURL />
417 <#if isDetailsPage == true>
418 <#assign detailsUrl = "${currentURL}${thisEntryId}${entry.getEntryId()}${thisEntryId}" />
419 </#if>
420
421 <div class="col-md-4 col-sm-12">
422 <#assign smallImageURL = getSmallImageUrl(entry)/>
423
424
425 <img class="image-medium" src= "${smallImageURL}" onerror="this.style.display='none'" alt=" "/>
426
427 </div>
428
429 <div class="col-md-8 col-sm-12">
430
431 <div class="entry-content">
432 <div class="entry-title">
433 <h3><a href="${detailsUrl}" style="color: #009c34">${htmlUtil.escape(entry.getTitle())}</a></h2>
434 </div>
435 </div>
436
437 <div class="entry-body">
438
439 <p>
440 ${stringUtil.shorten(htmlUtil.stripHtml(entry.getContent()), 280)}
441 </p>
442 <p>
443 <a class="read-more" href="${detailsUrl}" entrytitle="${entry.getUrlTitle()}">
444 Read full article<span class="hide-accessible"><@liferay.language key="about"/>${htmlUtil.escape(entry.getTitle())}</span> »
445 </a>
446 </p>
447
448 </div>
449
450 <div class="entry-footer">
451 <span class="entry-date">
452 <@liferay_ui["icon"] image="date" />
453 ${dateUtil.getDate(entry.getDisplayDate(), "dd MMM yyyy", locale)}
454 </span>
455
456 <#assign blogsEntryClassName = "com.liferay.blogs.model.BlogsEntry" />
457
458 </div>
459
460 </div>
461 </div>
462 </#if>
463
464 <div class="col-md-12 col-sm-12">
465 <div class="separator"><!-- --></div>
466 </div>
467 </#list>
468 </#if>
469</div>
470
471
472<#-- Right Pannel with the 5 most recent posts -->
473<#if isDetailsPage == true>
474 <div id="mostRecentBar" class="showBlogDetails col-md-3 hidden-sm hidden-xs" style="padding-right: 0px; padding-left: 0px;">
475<#else>
476 <div id="mostRecentBar" class="col-md-3 hidden-sm hidden-xs" style="padding-right: 0px; padding-left: 0px;">
477</#if>
478
479 <#if isDetailsPage == false>
480 <div id="blogMostRecentTop5" class="hidden">
481 <h3 style="color:black !important;">PREVIOUS POSTS</h3>
482 <#list entries as entry>
483 <div class="entry col-md-12" style="padding-bottom: 10px;">
484 <#assign viewURL = renderResponse.createRenderURL() />
485 ${viewURL.setParameter("struts_action", "/blogs/view")}
486 ${viewURL.setParameter("redirect", currentURL)}
487 ${viewURL.setParameter("urlTitle", entry.getUrlTitle() + thisEntryId + entry.getEntryId() + thisEntryId)}
488 <div class="col-md-4 col-sm-12" style="padding-right: 0px; padding-left: 0px;">
489 <#assign smallImageURL = getSmallImageUrl(entry)/>
490
491
492 <div class="image-small"
493 <#assign description = entry.getDescription() />
494 <#assign rightPaneImageKey = "<RightPaneImage=" />
495 <#assign diferentImageAssociated = false />
496 <#if (!validator.isNull(description))>
497 <#list description?split(">") as sValue>
498 <#if (sValue?trim?starts_with(rightPaneImageKey) && !diferentImageAssociated)>
499 style="background-image: url(${sValue?substring(sValue?index_of('=') + 1)})"
500 <#assign diferentImageAssociated = true />
501 </#if>
502 </#list>
503 <#if (!diferentImageAssociated)>
504 style='background-image: url("${smallImageURL}")'
505 </#if>
506 <#else>
507 style='background-image: url("${smallImageURL}")'
508 </#if>
509 >
510
511 </div>
512 </div>
513
514 <div class="col-md-8 col-sm-12">
515 <div class="entry-content">
516 <div class="entry-title">
517 <h2><a href="${viewURL}" style="color: #009c34">${htmlUtil.escape(entry.getTitle())}</a></h2>
518 </div>
519 </div>
520 <div class="entry-footer">
521 <span class="entry-date">
522 <@liferay_ui["icon"] image="date" />
523 ${dateUtil.getDate(entry.getDisplayDate(), "dd MMM yyyy", locale)}
524 </span>
525 </div>
526 </div>
527 </div>
528
529 <#-- Side panel contains only the first 5 entries -->
530 <#if (entry_index >= 4)>
531 <#break>
532 </#if>
533 </#list >
534 </div>
535 </#if>
536
537 <div id="blogSocialFeeds" class="">
538 <div class="entry col-md-12" style="padding-bottom: 10px;">
539 <h3 style="color:black !important;">Twitter</h3>
540 <a class="twitter-timeline" data-chrome="nofooter noheader transparent" data-width="300" data-height="500" href="https://twitter.com/ILTollway"></a>
541 <script>window.twttr = (function(d, s, id) {
542 var js, fjs = d.getElementsByTagName(s)[0],
543 t = window.twttr || {};
544 if (d.getElementById(id)) return t;
545 js = d.createElement(s);
546 js.id = id;
547 js.src = "https://platform.twitter.com/widgets.js";
548 fjs.parentNode.insertBefore(js, fjs);
549 t._e = [];
550 t.ready = function(f) {
551 t._e.push(f);
552 };
553 return t;
554 }(document, "script", "twitter-wjs"));</script>
555 </div>
556 <div class="entry col-md-12" style="padding-bottom: 10px;">
557 <br/>
558 <h3 style="color:black !important;">Facebook</h3>
559 <div class="fb-page" data-href="https://www.facebook.com/ILTollway" data-tabs="timeline" data-width="280" data-height="580" data-small-header="true" data-adapt-container-width="true" data-hide-cover="true" data-show-facepile="false"></div>
560 <script>
561 (function(d, s, id) {
562 var js, fjs = d.getElementsByTagName(s)[0];
563 if (d.getElementById(id)) return;
564 js = d.createElement(s); js.id = id;
565 js.src = 'https://connect.facebook.net/en_EN/sdk.js#xfbml=1&version=v3.2';
566 fjs.parentNode.insertBefore(js, fjs);
567 }(document, 'script', 'facebook-jssdk'));
568 </script>
569 </div>
570 <script>twttr.widgets.load()</script>
571 </div>
572</div>