Retour

Mes factures

Une erreur s'est produite en traitant le calibre.
?index_of(...) expects a string as its first argument.
1<#-- 
2Application display templates can be used to modify the look of a 
3specific application. 
4 
5Please use the left panel to quickly add commonly used variables. 
6Autocomplete is also available and can be invoked by typing "${". 
7--> 
8 
9<#assign assetEntryLocalService = serviceLocator.findService("com.liferay.portlet.asset.service.AssetEntryLocalService") /> 
10<#assign classNameLocalService = serviceLocator.findService("com.liferay.portal.service.ClassNameLocalService") /> 
11<#assign assetLinkLocalService = serviceLocator.findService("com.liferay.portlet.asset.service.AssetLinkLocalService") /> 
12<#assign bookmarksEntryLocalService = serviceLocator.findService("com.liferay.portlet.bookmarks.service.BookmarksEntryLocalService") /> 
13<#assign journalArticleLocalService = serviceLocator.findService("com.liferay.portlet.journal.service.JournalArticleLocalService") /> 
14<#assign journalStructureLocalService = serviceLocator.findService("com.liferay.portlet.dynamicdatamapping.service.DDMStructureLocalService") /> 
15<#assign dlFileEntryLocalService = serviceLocator.findService("com.liferay.portlet.documentlibrary.service.DLFileEntryLocalService") /> 
16 
17<#assign typeJournalArticle = "com.liferay.portlet.journal.model.JournalArticle" /> 
18<#assign typeBookmarksEntry = "com.liferay.portlet.bookmarks.model.BookmarksEntry" /> 
19<#assign typeDLFileEntry = "com.liferay.portlet.documentlibrary.model.DLFileEntry" /> 
20 
21<#assign journalArticle = journalArticleLocalService.getArticle(groupId, .vars['reserved-article-id'].data) /> 
22<#assign entry = assetEntryLocalService.getEntry(typeJournalArticle, journalArticle.getResourcePrimKey()) /> 
23<#assign relatedAssetTypedLists = buildRelatedAssetTypedLists(entry, "false") /> 
24 
25<#assign jaClassNameId = classNameLocalService.getClassNameId(typeJournalArticle) /> 
26 
27<#assign pdfViewer = '/fu/js/pdfjs/web/viewer.html?zoom=page-fit&file=' /> 
28 
29<#assign serviceContextThreadLocal = staticUtil["com.liferay.portal.service.ServiceContextThreadLocal"] /> 
30<#assign themeDisplay = serviceContextThreadLocal.getServiceContext().getThemeDisplay() /> 
31 
32<#assign carouselNb = 0 /> 
33 
34<#-- ARTICLE CONTAINER --> 
35 
36<div class="interior-article-container"> 
37     
38    <article class="interior-article interior-article-displayed interior-article-displayed-full"> 
39         
40        <section class="interior-article-mainContent"> 
41             
42            <#if relatedAssetTypedLists[typeJournalArticle]?? && relatedAssetTypedLists[typeJournalArticle]?has_content > 
43                <@getTypedRelatedAssets relatedAssetTypedLists=relatedAssetTypedLists type=typeJournalArticle structure="CDA_ZOOM_SUR" /> 
44            </#if> 
45             
46            <h2>${.vars['reserved-article-title'].data}</h2> 
47             
48            <#if Accroche.getData() != ""> 
49                <p class="interior-article-chapo">${Accroche.getData()}</p> 
50            </#if> 
51             
52            <#if Contenu.getSiblings()?has_content> 
53                <#list Contenu.getSiblings() as content> 
54                     
55                    <#assign isAccordion = "" /> 
56                    <#assign isZoomed = content.par_zoom.getData() /> 
57                    <#if isZoomed == "true" > 
58                        <#assign isAccordion = "accordion-paragraph" /> 
59                    </#if> 
60                     
61                    <#assign zoomedParagraph = "" /> 
62                    <#assign isZoomed = content.par_zoom.getData() /> 
63                    <#if isZoomed == "true" > 
64                        <#assign zoomedParagraph = "zoomed-paragraph" /> 
65                    </#if> 
66                     
67                    <#assign floatingMedia = "no-floating-media" /> 
68                    <#assign alignValue = "" /> 
69                    <#assign alignValue = content.Media.alignment.getData() /> 
70                    <#if alignValue == "fLeft" || alignValue == "fRight" > 
71                        <#assign floatingMedia = "floating-media" /> 
72                    <#elseif alignValue == "flexLeft" || alignValue == "flexRight"> 
73                        <#assign floatingMedia = "flex-media" /> 
74                    </#if> 
75                     
76                    <#assign contentTitle = content.content_title.getData() /> 
77                     
78                    <#assign mediaSrc = "" /> 
79                    <#assign urlIframePortlet = "" /> 
80                     
81                    <#if content.Media?? && content.Media?has_content > 
82                        <#assign mediaSrc = content.Media.getData()/> 
83                        <#assign urlIframePortlet = content.Media.url_iframe_portlet.getData() /> 
84                    </#if> 
85                     
86                     
87                    <#if contentTitle!="" || content.getData()!="" || mediaSrc!="" || urlIframePortlet !="" > 
88                         
89                        <div class="interior-article-paragraph ${zoomedParagraph} ${floatingMedia}"> 
90                             
91                            <#assign anchor = '' /> 
92                            <#if content.anchor?has_content> 
93                                <#assign anchor = content.anchor.getData() /> 
94                                <#if anchor != "" > 
95                                    <#assign anchor = 'id="'+anchor+'"' /> 
96                                </#if> 
97                            </#if> 
98                             
99                            <#if contentTitle != '' > 
100                                <#if isAccordion=="accordion-paragraph"> 
101                                    <h3 ${anchor} class="accordion-title accordion-title-expanded"><button type="button" class="accordion-title-button" role="tab" aria-expanded="true">${contentTitle}</button></h3> 
102                                <#else> 
103                                    <h3 ${anchor}>${contentTitle}</h3> 
104                                </#if> 
105                            </#if> 
106                             
107                            <#if isAccordion=="accordion-paragraph"> 
108                                <div class="accordion-content"> 
109                            </#if> 
110                             
111                            <#if floatingMedia == "no-floating-media" > 
112                             
113                                ${content.getData()?replace("<p></p>","")} 
114                                <#if content.Media?? && content.Media?has_content > 
115                                    <@getMedia media=content.Media urlIframePortlet=urlIframePortlet /> 
116                                </#if> 
117                                 
118                            <#elseif floatingMedia == "floating-media"> 
119                             
120                                <#if content.Media?? && content.Media?has_content > 
121                                    <@getMedia media=content.Media urlIframePortlet=urlIframePortlet /> 
122                                </#if> 
123                                ${content.getData()?replace("<p></p>","")} 
124                                <div class="clear-float"></div> 
125                                 
126                             <#elseif floatingMedia == "flex-media"> 
127                              
128                                <div class="flex-display flex-media-paragraph ${alignValue}"> 
129                                    <#if content.Media?? && content.Media?has_content > 
130                                        <@getMedia media=content.Media urlIframePortlet=urlIframePortlet /> 
131                                    </#if> 
132                                    <div class="flex-media-paragraph-content"> 
133                                        ${content.getData()?replace("<p></p>","")} 
134                                    </div> 
135                                </div> 
136                                 
137                            </#if> 
138                             
139                            <#if isAccordion=="accordion-paragraph"> 
140                                </div> 
141                            </#if> 
142                             
143                        </div> 
144                         
145                    </#if> 
146 
147                </#list> 
148            </#if> 
149              
150        </section> 
151         
152        <@getCustomRelatedAssets relatedAssetTypedLists=relatedAssetTypedLists /> 
153         
154    </article> 
155     
156    <footer class="interior-article-footer"> 
157        <ul class="interior-article-footer-items-list"> 
158            <li class="interior-article-footer-item interior-article-profile"><a class="inner-link" href="/tableau-de-bord" title="Gérer mon profil">Mon profil</a></li> 
159        <li class="interior-article-footer-item interior-article-rss"><a class="inner-link" href="/les-flux-rss-de-l-agglo">Les flux RSS de l'agglo</a></li> 
160        <li class="interior-article-footer-item interior-article-print"><button type="button" class="inner-link" title="Imprimer">Imprimer</button></li> 
161        <li class="interior-article-footer-item interior-article-mail"><button type="button" class="inner-link" title="Partager par mail">Partager par mail</button></li> 
162        <li class="interior-article-footer-item interior-article-linkedin"><button type="button" class="inner-link" title="Partager sur LinkedIn">Partager sur LinkedIn</button></li> 
163        <li class="interior-article-footer-item interior-article-twitter"><button type="button" class="inner-link" title="Partager sur Twitter">Partager sur Twitter</button></li> 
164        <li class="interior-article-footer-item interior-article-facebook"><button type="button" class="inner-link" title="Partager sur Facebook">Partager sur Facebook</button></li> 
165        </ul> 
166    </footer> 
167     
168</div> 
169 
170<#-- FOOTER CONTACT --> 
171 
172<footer class="interior-content-footer interior-content-footer-displayed"> 
173     
174    <#if relatedAssetTypedLists[typeJournalArticle]?? && relatedAssetTypedLists[typeJournalArticle]?has_content > 
175        <@getTypedRelatedAssets relatedAssetTypedLists=relatedAssetTypedLists type=typeJournalArticle structure="CDA_CONTACT_SERVICE" /> 
176    <#else> 
177        <@getDefaultFooterContact /> 
178    </#if> 
179 
180</footer> 
181 
182 
183<#--************************************* 
184** MEDIA DISPLAY 
185*************************************--> 
186 
187<#macro getMedia media urlIframePortlet> 
188     
189    <#local mediaSrc = media.getData()/> 
190     
191    <#if mediaSrc != '' || urlIframePortlet != ''> 
192         
193        <#local mediaType = media.media_type.getData() /> 
194        <#assign carouselWrapper = "" /> 
195        <#if mediaType == "carousel"> 
196            <#assign carouselWrapper = "interior-article-media-carousel-wrapper" /> 
197        </#if> 
198        <#local width = media.width.getData() /> 
199        <#local displayWidth = '' /> 
200        <#if width == 'null'> 
201            <#local displayWidth = '' /> 
202        <#elseif width != ""> 
203            <#local displayWidth = 'style="width:'+width+'px;"' /> 
204        </#if> 
205         
206        <#local height = media.height.getData() /> 
207        <#if height == 'null'> 
208            <#local height = '' /> 
209        </#if> 
210        <#local displayMode = media.display_mode.getData() /> 
211        <#local imgMini = media.img_mini.getData() /> 
212        <#local alignment = media.alignment.getData() /> 
213        <#local legend = media.legend.getData() /> 
214        <#local altText = media.alt_text.getData() /> 
215        <#if altText == 'null'> 
216            <#local altText = '' /> 
217        </#if> 
218         
219        <figure class="interior-article-media interior-article-media-${alignment} ${carouselWrapper}" ${displayWidth}> 
220             
221            <#switch mediaType> 
222                <#case "image"> 
223                    <#if displayMode == "normal"> 
224                       <@getImageMedia mediaSrc=mediaSrc urlIframePortlet=urlIframePortlet altText=altText height=height /> 
225                    <#elseif displayMode == "popup"> 
226                        <@getImageMediaPopup imgMini=imgMini mediaSrc=mediaSrc altText=altText height=height /> 
227                    </#if> 
228                    <#break > 
229                <#case "video"> 
230                    <#if displayMode == "normal"> 
231                       <@getVideoMedia imgMini=imgMini mediaSrc=mediaSrc altText=altText height=height /> 
232                    <#elseif displayMode == "popup"> 
233                        <@getVideoMediaPopup imgMini=imgMini mediaSrc=mediaSrc altText=altText height=height /> 
234                    </#if> 
235                    <#break > 
236                <#case "pdf"> 
237                    <#if displayMode == "normal"> 
238                       <@getPdfMedia mediaSrc=mediaSrc height=height /> 
239                    <#elseif displayMode == "popup"> 
240                        <@getPdfMediaPopup imgMini=imgMini mediaSrc=mediaSrc altText=altText height=height /> 
241                    </#if> 
242                    <#break > 
243                <#case "iframe"> 
244                    <#if displayMode == "normal"> 
245                       <@getIframeMedia urlIframePortlet=urlIframePortlet altText=altText height=height /> 
246                    <#elseif displayMode == "popup"> 
247                        <@getIframeMediaPopup imgMini=imgMini urlIframePortlet=urlIframePortlet altText=altText height=height /> 
248                    </#if> 
249                    <#break > 
250                <#case "svg"> 
251                    <#if displayMode == "normal"> 
252                       <@getSvgMedia mediaSrc=mediaSrc height=height /> 
253                    <#elseif displayMode == "popup"> 
254                        <@getSvgMediaPopup imgMini=imgMini mediaSrc=mediaSrc altText=altText height=height /> 
255                    </#if> 
256                    <#break > 
257                <#case "flash"> 
258                    <#if displayMode == "normal"> 
259                       <@getFlashMedia mediaSrc=mediaSrc height=height /> 
260                    <#elseif displayMode == "popup"> 
261                        <@getFlashMediaPopup imgMini=imgMini mediaSrc=mediaSrc altText=altText height=height /> 
262                    </#if> 
263                    <#break > 
264                <#case "portlet"> 
265                    <#if displayMode == "normal"> 
266                       <@getPortletMedia urlIframePortlet=urlIframePortlet height=height /> 
267                    <#elseif displayMode == "popup"> 
268                        <@getPortletMediaPopup imgMini=imgMini urlIframePortlet=urlIframePortlet altText=altText height=height /> 
269                    </#if> 
270                    <#break > 
271                <#case "flickr"> 
272                    <#if displayMode == "normal"> 
273                       <@getFlickrMedia urlIframePortlet=urlIframePortlet /> 
274                    <#elseif displayMode == "popup"> 
275                        <@getFlickrMediaPopup imgMini=imgMini urlIframePortlet=urlIframePortlet altText=altText height=height /> 
276                    </#if> 
277                    <#break > 
278                <#case "gallery"> 
279                    <#if displayMode == "normal"> 
280                       <@getGalleryMedia mediaSrc=mediaSrc height=height /> 
281                    <#elseif displayMode == "popup"> 
282                        <@getGalleryMediaPopup imgMini=imgMini mediaSrc=mediaSrc altText=altText height=height /> 
283                    </#if> 
284                    <#break > 
285                <#case "carousel"> 
286                    <#if displayMode == "normal"> 
287                       <@getCarouselMedia media=media mediaSrc=mediaSrc altText=altText height=height width=width /> 
288                       <#assign carouselNb = carouselNb + 1 /> 
289                    <#elseif displayMode == "popup"> 
290                        <@getCarouselMediaPopup imgMini=imgMini media=media mediaSrc=mediaSrc altText=altText height=height /> 
291                    </#if> 
292                    <#break > 
293                <#case "audio"> 
294                    <@getAudioMedia mediaSrc=mediaSrc altText=altText /> 
295                    <#break > 
296                <#default> 
297            </#switch> 
298             
299            <#local hasLegend = legend?length != 0 /> 
300            <#if hasLegend> 
301                <figcaption class="interior-article-media-legend">${legend}</figcaption> 
302            </#if> 
303             
304        </figure> 
305         
306    </#if> 
307     
308</#macro> 
309 
310 
311<#macro getImageMedia mediaSrc urlIframePortlet altText height > 
312    <#local displayedHeight = '' /> 
313    <#if height != ""> 
314        <#local displayedHeight = 'style="max-height:'+height+'px;"' /> 
315    </#if> 
316    <#if urlIframePortlet != ""> 
317        <#assign target = "href='"+ urlIframePortlet +"'" /> 
318        <#if !isInternalLink(urlIframePortlet)> 
319            <#assign target = target + " target='_blank' rel='noopener noreferrer'" /> 
320        </#if> 
321        <a ${target}> 
322    </#if> 
323    <img class="interior-article-media-image" src="${mediaSrc}" alt="${altText}" ${displayedHeight} /> 
324    <#if urlIframePortlet != ""> 
325        </a> 
326    </#if> 
327</#macro> 
328 
329 
330<#macro getImageMediaPopup imgMini mediaSrc altText height > 
331    <#local displayedHeight = '' /> 
332    <#if height != ""> 
333        <#local displayedHeight = 'style="max-height:'+height+'px;"' /> 
334    </#if> 
335    <a class="link-img" href="${mediaSrc}" title="${altText}"> 
336        <img class="interior-article-media-image" src="${imgMini}" alt="${altText}" ${displayedHeight} /> 
337    </a> 
338</#macro> 
339 
340 
341<#macro getVideoMedia imgMini mediaSrc height altText> 
342    <#local displayedHeight = '' /> 
343    <#if height != ""> 
344        <#local displayedHeight = 'style="max-height:'+height+'px;"' /> 
345    </#if> 
346    <video class="interior-article-media-video" itemprop="url" poster="${imgMini}" title="${htmlUtil.escapeAttribute(altText)}" controls="" preload="auto" ${displayedHeight} > 
347        <source itemprop="url" content="https://www2.larochelle-technopole.fr${mediaSrc}" src="${mediaSrc}" type="video/mp4"> 
348        <a href="${mediaSrc}" download="">${htmlUtil.escapeAttribute(altText)}</a> 
349    </video> 
350</#macro> 
351 
352 
353<#macro getVideoMediaPopup imgMini mediaSrc altText height > 
354    <#local displayedHeight = '' /> 
355    <#if height != ""> 
356        <#local displayedHeight = 'style="max-height:'+height+'px;"' /> 
357    </#if> 
358    <a class="link-video" href="${mediaSrc}" title="${altText}"> 
359        <img class="interior-article-media-image" src="/cdalr-new-theme/images/blank.png" data-src="${imgMini}" alt="${htmlUtil.escapeAttribute(altText)}" ${displayedHeight} /> 
360    </a> 
361</#macro> 
362 
363 
364<#macro getAudioMedia mediaSrc altText> 
365    <audio class="interior-article-media-audio" title="${htmlUtil.escapeAttribute(altText)}" alt="${htmlUtil.escapeAttribute(altText)}" controls="" > 
366        <source src="${mediaSrc}" type="audio/mpeg"> 
367        <a href="${mediaSrc}" download="">${htmlUtil.escapeAttribute(altText)}</a> 
368    </audio> 
369</#macro> 
370 
371 
372<#macro getPdfMedia mediaSrc altText height > 
373    <#local displayedHeight = '' /> 
374    <#if height != ""> 
375        <#local displayedHeight = 'style="height:'+height+'px;"' /> 
376    </#if> 
377    <iframe class="interior-article-media-iframe" src="${pdfViewer+mediaSrc}" title="${htmlUtil.escapeAttribute(altText)}" ${displayedHeight} allowfullscreen ></iframe> 
378</#macro> 
379 
380 
381<#macro getPdfMediaPopup imgMini mediaSrc altText height > 
382    <#local displayedHeight = '' /> 
383    <#if height != ""> 
384        <#local displayedHeight = 'style="max-height:'+height+'px;"' /> 
385    </#if> 
386    <a class="popup-img-opener" href="${mediaSrc}" title="${htmlUtil.escapeAttribute(altText)}" target="_blank" rel="noopener noreferrer"> 
387        <img class="interior-article-media-image" src="/cdalr-new-theme/images/blank.png" data-src="${imgMini}" alt="${htmlUtil.escapeAttribute(altText)}" ${displayedHeight} /> 
388    </a> 
389</#macro> 
390 
391 
392<#macro getIframeMedia urlIframePortlet altText height > 
393    <#local displayedHeight = '' /> 
394    <#if height != ""> 
395        <#local displayedHeight = 'style="height:'+height+'px;"' /> 
396    </#if> 
397    <#local scrolling = '' /> 
398    <#if altText == "no-scrolling"> 
399        <#local scrolling = 'scrolling="no"' /> 
400    </#if> 
401    <iframe class="interior-article-media-iframe" src="${urlIframePortlet}" ${displayedHeight} allowfullscreen ${scrolling} title="${htmlUtil.escapeAttribute(altText)}"></iframe> 
402</#macro> 
403 
404 
405<#macro getIframeMediaPopup imgMini urlIframePortlet altText height > 
406    <#local displayedHeight = '' /> 
407    <#if height != ""> 
408        <#local displayedHeight = 'style="max-height:'+height+'px;"' /> 
409    </#if> 
410    <a class="link-iframe" href="${urlIframePortlet}" target="_blank" rel="noopener noreferrer"> 
411        <img class="interior-article-media-image" src="${imgMini}" alt="${altText}" ${displayedHeight} /> 
412    </a> 
413</#macro> 
414 
415 
416<#macro getSvgMedia mediaSrc height > 
417 
418</#macro> 
419 
420 
421<#macro getSvgMediaPopup imgMini mediaSrc altText height > 
422 
423</#macro> 
424 
425 
426<#macro getFlashMedia mediaSrc height > 
427    <#local displayedHeight = '' /> 
428    <#if height != ""> 
429        <#local displayedHeight = 'style="height:'+height+'px;"' /> 
430    </#if> 
431    <object class="interior-article-media-object" type="application/x-shockwave-flash"  data="${mediaSrc}" ${displayedHeight}></object>  
432</#macro> 
433 
434 
435<#macro getFlashMediaPopup imgMini mediaSrc altText height > 
436    <#local displayedHeight = '' /> 
437    <#if height != ""> 
438        <#local displayedHeight = 'style="max-height:'+height+'px;"' /> 
439    </#if> 
440    <a class="link-flash" href="${mediaSrc}"> 
441        <img class="interior-article-media-image" src="${imgMini}" alt="${altText}" ${displayedHeight} /> 
442    </a> 
443</#macro> 
444 
445 
446<#macro getPortletMedia urlIframePortlet height > 
447     
448    <#local displayedHeight = '' /> 
449    <#if height != ""> 
450        <#local displayedHeight = 'style="max-height:'+height+'px;"' /> 
451    </#if> 
452     
453    <#local hasInstanceId = urlIframePortlet?contains('INSTANCE') /> 
454    <#local hasQueryString = urlIframePortlet?contains('?') /> 
455    <#local portletId = urlIframePortlet /> 
456    <#local queryString = '' /> 
457     
458    <#if hasInstanceId> 
459        <#local portletId = urlIframePortlet[0..(urlIframePortlet?index_of(instanceId))] /> 
460    </#if> 
461    <#if hasQueryString> 
462        <#local portletId = urlIframePortlet[0..(urlIframePortlet?index_of('?')-1)] /> 
463        <#local queryString = urlIframePortlet[(urlIframePortlet?index_of('?')+1)..] /> 
464    </#if> 
465     
466    <#local divId = "embedded-portlet-" + portletId /> 
467    <#local plid = themeDisplay.plid /> 
468     
469    <#if urlIframePortlet?contains('cdalrEService') || urlIframePortlet?contains('cdalrEservice') || urlIframePortlet?contains('cuCreate')> 
470        <#local queryString = queryString +"&p_l_id="+plid+"&p_p_lifecycle=0&p_p_mode=view&p_p_state=exclusive" /> 
471     
472        <div id="${divId}" class="embedded-portlet" data-portlet="${portletId}" data-querystring="${queryString}" data-remote-url="" ${displayedHeight}></div> 
473         
474    <#else> 
475         
476        <#local remoteUrl = "/c/portal/layout?p_l_id="+plid+"&p_p_id="+portletId+"&p_p_lifecycle=0&p_p_mode=view&p_p_state=exclusive"+queryString /> 
477         
478        <div id="${divId}" class="embedded-portlet" data-portlet="${portletId}" data-querystring="${queryString}" data-remote-url="${remoteUrl}" ${displayedHeight}></div> 
479         
480    </#if> 
481     
482</#macro> 
483 
484 
485<#macro getPortletMediaPopup imgMini urlIframePortlet altText height > 
486       
487    <#local divId = "embedded-portlet-" + urlIframePortlet /> 
488     
489    <#local displayedHeight = '' /> 
490    <#if height != ""> 
491        <#local displayedHeight = 'style="max-height:'+height+'px;"' /> 
492    </#if> 
493     
494    <#local hasInstanceId = urlIframePortlet?contains('INSTANCE') /> 
495    <#local hasQueryString = urlIframePortlet?contains('?') /> 
496    <#local portletId = urlIframePortlet /> 
497    <#local queryString = '' /> 
498 
499    <#if hasInstanceId> 
500        <#local portletId = urlIframePortlet[0..(urlIframePortlet?index_of(instanceId))] /> 
501    </#if> 
502    <#if hasQueryString> 
503        <#local portletId = urlIframePortlet[0..(urlIframePortlet?index_of('?')-1)] /> 
504        <#local queryString = urlIframePortlet[(urlIframePortlet?index_of('?')+1)..] /> 
505    </#if> 
506     
507    <#if themeDisplay?? && themeDisplay.plid?? > 
508         
509        <#local plid = themeDisplay.plid /> 
510         
511        <#if urlIframePortlet?contains('cdalrEService') || urlIframePortlet?contains('cdalrEservice') > 
512            <#local queryString = queryString +"&p_l_id="+plid+"&p_p_lifecycle=0&p_p_mode=view&p_p_state=exclusive" /> 
513      
514            <#local formTitle = "" /> 
515            <#local formPictoClass = "" /> 
516            <#if urlIframePortlet?contains('FiberOpticalConnectionRequest')> 
517                <#local formTitle = "Demande d'information pour le raccordement à la fibre optique" /> 
518                <#local formPictoClass = "eservice-form-opener-picto-fiber" /> 
519            <#elseif urlIframePortlet?contains('AntContact')> 
520                <#local formTitle = "Contacter l'aménagement numérique du territoire" /> 
521                <#local formPictoClass = "eservice-form-opener-picto-contact" /> 
522            <#elseif urlIframePortlet?contains('ReinscriptionConservatoire')> 
523                <#local formTitle = "Formulaire de réinscription au conservatoire" /> 
524                <#local formPictoClass = "eservice-form-opener-picto-music" /> 
525            <#elseif urlIframePortlet?contains('ContactUs')> 
526                <#local formTitle = "Contacter l'agglo" /> 
527                <#local formPictoClass = "eservice-form-opener-picto-contact" /> 
528            <#elseif urlIframePortlet?contains('JobApplication')> 
529                <#local formTitle = "Postuler à une offre d'emploi" /> 
530                <#local formPictoClass = "eservice-form-opener-picto-job" /> 
531            <#elseif urlIframePortlet?contains('WastebinRepair')> 
532                <#local formTitle = "Demande de nouveau bac ou de réparation" /> 
533                <#local formPictoClass = "eservice-form-opener-picto-wastebin" /> 
534            <#elseif urlIframePortlet?contains('WastewaterConnection')> 
535                <#local formTitle = "Raccorder ou brancher mon installation au réseau d'eaux usées" /> 
536                <#local formPictoClass = "eservice-form-opener-picto-water" /> 
537            <#elseif urlIframePortlet?contains('WastesortingTour')> 
538                <#local formTitle = "Visiter le centre de tri" /> 
539                <#local formPictoClass = "eservice-form-opener-picto-altriane" /> 
540            </#if> 
541             
542            <div class="link-portlet eservice-form-opener" data-divId="${divId}" data-portlet="${portletId}" data-querystring="${queryString}" data-remote-url="" tabindex="0"> 
543                <div class="eservice-form-opener-picto ${formPictoClass}"></div> 
544                <p class="eservice-form-opener-text">${formTitle}</p> 
545            </div> 
546             
547        <#else> 
548             
549            <#local portletClass = "link-portlet" /> 
550            <#if urlIframePortlet?contains('19_WAR')> 
551                <#local portletClass = "link-portlet planning-cmd-opener" /> 
552            </#if> 
553            <#local remoteUrl = "/c/portal/layout?p_l_id="+plid+"&p_p_id="+portletId+"&p_p_lifecycle=0&p_p_mode=view&p_p_state=exclusive"+queryString /> 
554         
555            <div class="${portletClass}" data-divId="${divId}" data-portlet="${portletId}" data-querystring="${queryString}" data-remote-url="${remoteUrl}" tabindex="0"> 
556                <img class="interior-article-media-image" src="${imgMini}" alt="${altText}" ${displayedHeight} /> 
557            </div> 
558         
559        </#if> 
560         
561    </#if> 
562     
563</#macro> 
564 
565 
566<#macro getFlickrMedia urlIframePortlet > 
567    <div class="interior-article-media-flickr" data-embed-flickr='${urlIframePortlet}'></div> 
568</#macro> 
569 
570 
571<#macro getFlickrMediaPopup imgMini urlIframePortlet altText height > 
572    <#local displayedHeight = '' /> 
573    <#if height != ""> 
574        <#local displayedHeight = 'style="max-height:'+height+'px;"' /> 
575    </#if> 
576    <div class="link-flickr" data-flickr='${urlIframePortlet}' tabindex="0"> 
577        <img class="interior-article-media-image" src="/cdalr-new-theme/images/blank.png" data-src="${imgMini}" alt="${altText}" ${displayedHeight} /> 
578    </div> 
579</#macro> 
580 
581 
582<#macro getGalleryMedia mediaSrc height > 
583 
584</#macro> 
585 
586 
587<#macro getGalleryMediaPopup imgMini mediaSrc altText height > 
588 
589</#macro> 
590 
591 
592<#macro getCarouselMedia media mediaSrc altText height width >  
593     
594    <#local ratioDisplay = "" /> 
595    <#if height != "" && width != "" > 
596        <#local ratio = height?number / width?number * 100 /> 
597        <#local ratioDisplay = 'style="padding-top:' + ratio + '%"' /> 
598    </#if> 
599     
600    <div class="carousel" id="carousel-${carouselNb}" data-carousel="carousel-${carouselNb}" ${ratioDisplay}> 
601         
602        <button type="button" id="carousel-${carouselNb}-arrow-prev" data-carousel="carousel-${carouselNb}" data-direction="prev" class="carousel-arrow carousel-arrow-prev">Image précédente</button> 
603        <button type="button" id="carousel-${carouselNb}-arrow-next" data-carousel="carousel-${carouselNb}" data-direction="next" class="carousel-arrow carousel-arrow-next">Image suivante</button> 
604 
605        <img id="carousel-${carouselNb}-img-0" data-carousel="carousel-${carouselNb}" data-img="0" class="carousel-img carousel-img-displayed" src="/cdalr-new-theme/images/blank.png" data-src="${mediaSrc}" alt="${altText}"> 
606 
607        <#if media.media_more??> 
608            <#list media.media_more.getSiblings() as node> 
609                <img id="carousel-${carouselNb}-img-${node_index+1}" data-carousel="carousel-${carouselNb}" data-img="${node_index+1}" class="carousel-img carousel-img-noDisplay" src="/cdalr-new-theme/images/blank.png" data-src="${node.getData()}" alt="${altText}"> 
610            </#list> 
611        </#if> 
612 
613    </div> 
614 
615</#macro> 
616 
617 
618<#macro getCarouselMediaPopup imgMini media mediaSrc altText height > 
619    <#local diapos = mediaSrc /> 
620    <#if media.media_more??> 
621        <#list media.media_more.getSiblings() as node> 
622            <#if node_index != 0> 
623                <#local diapos = diapos + "," /> 
624            </#if> 
625            <#local diapos = diapos + node.getData() /> 
626        </#list> 
627    </#if> 
628    <#local displayedHeight = '' /> 
629    <#if height != ""> 
630        <#local displayedHeight = 'style="max-height:'+height+'px;"' /> 
631    </#if> 
632    <a class="link-diapo popup-img-opener" href="${mediaSrc}" title="${htmlUtil.escapeAttribute(altText)}" data-diapos="${diapos}"> 
633        <img class="interior-article-media-image" src="/cdalr-new/images/blank.png" data-src="${imgMini}" alt="${htmlUtil.escapeAttribute(altText)}" ${displayedHeight} /> 
634    </a> 
635</#macro> 
636 
637 
638<#--************************************* 
639**  RELATED CONTENT 
640*************************************--> 
641 
642<#function buildRelatedAssetTypedLists entry info > 
643    <#assign relatedAssetTypedLists = {} /> 
644    <#assign infos = "" /> 
645    <#assign assetLinks = assetLinkLocalService.getDirectLinks(entry.getEntryId()) /> 
646 
647    <#list assetLinks as assetLink> 
648        <#if assetLink.getEntryId1() == entry.getEntryId() > 
649            <#assign assetLinkEntry = assetEntryLocalService.getEntry(assetLink.getEntryId2()) /> 
650        <#else> 
651            <#assign assetLinkEntry = assetEntryLocalService.getEntry(assetLink.getEntryId1()) /> 
652        </#if> 
653         
654        <#if assetLinkEntry?? && assetLinkEntry.isVisible() > 
655            <#assign linkedAssetRenderer = assetLinkEntry.getAssetRenderer() /> 
656     
657            <#if linkedAssetRenderer.hasViewPermission(permissionChecker) > 
658             
659                <#assign type = assetLinkEntry.getClassName() /> 
660                 
661                <#assign newEntry = [{"assetEntry":assetLinkEntry,"assetLink":assetLink}] /> 
662                <#if relatedAssetTypedLists?keys?seq_contains(type)> 
663                    <#assign relatedAssetTypedList = relatedAssetTypedLists[type] + newEntry /> 
664                <#else> 
665                    <#assign relatedAssetTypedList = newEntry /> 
666                </#if> 
667                <#assign relatedAssetTypedLists = relatedAssetTypedLists + {type : relatedAssetTypedList} /> 
668                <#-- 
669                <#assign infos> 
670                    ${infos} ${type}=${relatedAssetTypedLists[type]?size}  (${newEntry?first.getClassPK()}) <br/> 
671                </#assign> 
672                --> 
673            </#if> 
674        </#if> 
675    </#list> 
676     
677    <#if info == "true"> 
678        <#return infos /> 
679    <#else> 
680        <#return relatedAssetTypedLists /> 
681    </#if> 
682    <#return {} /> 
683</#function> 
684 
685 
686<#macro getCustomRelatedAssets relatedAssetTypedLists> 
687    <#local hasRelatedAssets = "false" /> 
688    <#if relatedAssetTypedLists[typeBookmarksEntry]?? && relatedAssetTypedLists[typeBookmarksEntry]?size != 0> 
689        <#local hasRelatedAssets = "true" /> 
690    </#if> 
691    <#if relatedAssetTypedLists[typeDLFileEntry]?? && relatedAssetTypedLists[typeDLFileEntry]?size != 0> 
692        <#local hasRelatedAssets = "true" /> 
693    </#if> 
694    <#-- 
695    <#if relatedAssetTypedLists[typeJournalArticle]?? && relatedAssetTypedLists[typeJournalArticle]?has_content > 
696        <#local webContentNb = getRelatedWebContentNb(relatedAssetTypedLists[typeJournalArticle]) /> 
697        <#if webContentNb != 0> 
698            <#local hasRelatedAssets = "true" /> 
699        </#if> 
700    </#if> 
701    --> 
702    <#if hasRelatedAssets == "true" > 
703        <aside class="interior-article-moreContent-container"> 
704            <p class="interior-article-moreContent-title">En savoir plus</p> 
705            <#if relatedAssetTypedLists[typeBookmarksEntry]?? && relatedAssetTypedLists[typeBookmarksEntry]?has_content > 
706                <@getTypedRelatedAssets relatedAssetTypedLists=relatedAssetTypedLists type=typeBookmarksEntry structure=""/> 
707            </#if> 
708            <#if relatedAssetTypedLists[typeDLFileEntry]?? && relatedAssetTypedLists[typeDLFileEntry]?has_content > 
709                <@getTypedRelatedAssets relatedAssetTypedLists=relatedAssetTypedLists type=typeDLFileEntry structure="" /> 
710            </#if> 
711        </aside> 
712    </#if> 
713</#macro> 
714 
715 
716<#macro getTypedRelatedAssets relatedAssetTypedLists type structure> 
717    <#if type == typeJournalArticle && structure == "CDA_ZOOM_SUR" > 
718        <@getRelatedZoomSur assets=relatedAssetTypedLists[type] /> 
719    <#elseif type == typeJournalArticle && structure == "CDA_CONTACT_SERVICE" > 
720        <@getRelatedFooterContact assets=relatedAssetTypedLists[type] /> 
721    <#elseif type == typeBookmarksEntry > 
722        <@getRelatedPages assets=relatedAssetTypedLists[type] /> 
723    <#elseif type == typeDLFileEntry > 
724        <@getRelatedDocuments assets=relatedAssetTypedLists[type] /> 
725    </#if> 
726</#macro> 
727 
728 
729<#macro getRelatedZoomSur assets> 
730    <#if assets?size != 0> 
731        <#list assets as assetMap> 
732            <#local asset = assetMap.assetEntry /> 
733            <#local article = journalArticleLocalService.getLatestArticle(asset.getClassPK()) /> 
734            <#assign strucName = journalStructureLocalService.getStructure(article.groupId, jaClassNameId, article.structureId?string, true).getName(locale) /> 
735            <#if strucName == 'CDA_ZOOM_SUR'> 
736                <#local img = getField(article,"back_img")/> 
737                <#local url = getField(article,"url_link")/> 
738                <#local target = "href='"+ url +"'" /> 
739                <#if !isInternalLink(url)> 
740                    <#local target = target + " target='_blank' rel='noopener noreferrer'" /> 
741                </#if> 
742                <div class="article-header-alert"> 
743                    <#if url != ""> 
744                        <a class="inner-link" ${target}> 
745                    </#if> 
746                    <img src="${img}" alt="${asset.getTitleCurrentValue()}"/> 
747                    <h3 class="article-header-alert-title">${asset.getTitleCurrentValue()}</h3> 
748                    <#if url != ""> 
749                        </a> 
750                    </#if> 
751                </div> 
752            </#if> 
753        </#list> 
754    </#if> 
755</#macro> 
756 
757<#macro getRelatedFooterContact assets> 
758    <#if assets?size == 0> 
759        <@getDefaultFooterContact /> 
760    <#else> 
761        <#local hasContactFooter = false /> 
762        <#list assets as assetMap> 
763            <#local asset = assetMap.assetEntry /> 
764            <#local article = journalArticleLocalService.getLatestArticle(asset.getClassPK()) /> 
765            <#assign strucName = journalStructureLocalService.getStructure(article.groupId, jaClassNameId, article.structureId?string, true).getName(locale) /> 
766            <#if strucName == 'CDA_CONTACT_SERVICE'> 
767                <#local contact_service = getField(article,"Contact_service")/> 
768                <#local adresse = getField(article,"Adresse")/> 
769                <#local cp = getField(article,"CP")/> 
770                <#local ville = getField(article,"Ville")/> 
771                <#local telephone = getField(article,"Telephone")/> 
772                <#if telephone==""> 
773                    <#local telephone = "05 46 30 34 00" /> 
774                </#if> 
775                <#local courriel = getField(article,"Courriel")/> 
776                <#local annuaire = getField(article,"annuaire_link")/> 
777                <#if annuaire==""> 
778                    <#local annuaire = "/annuaire-des-services"/> 
779                </#if> 
780                <a class="interior-content-footer-contact interior-content-footer-service" href="${annuaire}"> 
781                    Contact<br/> 
782                    ${asset.getTitle(locale)} 
783                </a> 
784                <p class="interior-content-footer-contact interior-content-footer-address"> 
785                    <span class="interior-content-footer-contact-inner">${adresse}<br/>${cp} ${ville}</span> 
786                </p> 
787                <p class="interior-content-footer-contact interior-content-footer-phone"> 
788                    <span class="interior-content-footer-contact-inner">${telephone}</span> 
789                </p> 
790                <a class="interior-content-footer-contact interior-content-footer-email" href="mailto:${courriel}?subject=Contact%20site%20Agglo"> 
791                    <span class="interior-content-footer-contact-inner">Envoyer un courriel</span> 
792                </a> 
793                <a class="interior-content-footer-annuaire" href="${annuaire}">Annuaire des services</a> 
794                <#local hasContactFooter = true /> 
795                <#break /> 
796            </#if> 
797        </#list> 
798        <#if hasContactFooter == false> 
799            <@getDefaultFooterContact /> 
800        </#if> 
801    </#if> 
802</#macro> 
803 
804 
805<#macro getDefaultFooterContact > 
806    <a class="interior-content-footer-contact interior-content-footer-service" href="/annuaire-des-services"> 
807        Contact<br/> 
808        Agglo La Rochelle 
809    </a> 
810    <p class="interior-content-footer-contact interior-content-footer-address"> 
811        <span class="interior-content-footer-contact-inner">6, rue Saint-Michel<br/>17000 La Rochelle</span> 
812    </p> 
813    <p class="interior-content-footer-contact interior-content-footer-phone"> 
814        <span class="interior-content-footer-contact-inner">05 46 30 34 00</span> 
815    </p> 
816    <a class="interior-content-footer-contact interior-content-footer-email" href="/contacter-l-agglo"> 
817        <span class="interior-content-footer-contact-inner">Envoyer un courriel</span> 
818    </a> 
819    <a class="interior-content-footer-annuaire" href="/annuaire-des-services">Annuaire des services</a> 
820</#macro> 
821 
822 
823<#function getRelatedWebContentNb assets> 
824    <#local nb = 0 /> 
825    <#if assets?size != 0> 
826        <#local nb = 0 /> 
827        <#list assets as assetMap> 
828            <#local asset = assetMap.assetEntry /> 
829            <#local article = journalArticleLocalService.getLatestArticle(asset.getClassPK()) /> 
830            <#assign strucName = journalStructureLocalService.getStructure(article.groupId, jaClassNameId, article.structureId?string, true).getName(locale) /> 
831            <#if strucName != 'CDA_CONTACT_SERVICE' && strucName != 'CDA_ZOOM_SUR'> 
832                <#local nb = nb + 1 /> 
833            </#if> 
834        </#list> 
835    </#if> 
836    <#return nb /> 
837</#function> 
838 
839 
840<#macro getRelatedPages assets> 
841    <ul> 
842        <#local orderedAssets = getOrderedAssets(assets) /> 
843        <#list orderedAssets?reverse as assetMap> 
844            <#local asset = assetMap.assetEntry /> 
845            <#local assetLink = assetMap.assetLink /> 
846            <#local linkedAssetRenderer = asset.getAssetRenderer() /> 
847            <#local assetLinkEntryTitle = asset.getTitle(locale) /> 
848            <#local assetLinkEntryDescription = asset.getDescription() /> 
849            <#local assetLinkBookmark = bookmarksEntryLocalService.getEntry(asset.getClassPK()) /> 
850            <#local assetURL = assetLinkBookmark.getUrl() /> 
851             
852            <#local target = "" /> 
853            <#if assetURL?contains('widget') || assetURL?contains('iframe') || assetURL?contains('embed') > 
854                <#local target = " data-iframe='true' href='"+ assetURL +"' class='link-iframe'" /> 
855            <#else> 
856                <#local target = "href='"+ assetURL +"'" /> 
857                <#if !isInternalLink(assetURL)> 
858                    <#local target = target + " target='_blank' rel='noopener noreferrer'" /> 
859                </#if> 
860            </#if> 
861 
862            <li class="interior-article-moreContent" data-entry-id="${asset.getEntryId()}"><a ${target} title="${htmlUtil.escapeAttribute(assetLinkEntryDescription)}">${assetLinkEntryTitle}</a></li> 
863       </#list> 
864   </ul> 
865</#macro> 
866 
867 
868<#macro getRelatedDocuments assets> 
869     
870    <#assign folderNb = 0 /> 
871    <#local orderedAssets = getOrderedAssets(assets) /> 
872    <#local collapsedFolders = false /> 
873     
874    <#list orderedAssets?reverse as assetMap> 
875     
876        <#local asset = assetMap.assetEntry /> 
877        <#local fileEntry = dlFileEntryLocalService.getFileEntry(asset.getClassPK()) /> 
878 
879        <#local documents = dlFileEntryLocalService.getFileEntries(fileEntry.getGroupId(),fileEntry.getFolderId()) /> 
880        <#local folder = fileEntry.getFolder() /> 
881        <#local folderDescription = folder.getDescription()/> 
882        <#if folderDescription != ""> 
883            <#if documents?size &gt; 5> 
884                <#local collapsedFolders = true /> 
885            </#if> 
886        </#if> 
887    </#list> 
888     
889    <#list orderedAssets?reverse as assetMap> 
890     
891        <#local asset = assetMap.assetEntry /> 
892        <#local fileEntry = dlFileEntryLocalService.getFileEntry(asset.getClassPK()) /> 
893 
894        <#local documents = dlFileEntryLocalService.getFileEntries(fileEntry.getGroupId(),fileEntry.getFolderId()) /> 
895        <#local folder = fileEntry.getFolder() /> 
896        <#local folderDescription = folder.getDescription()/> 
897        <#if folderDescription != ""> 
898            <#if collapsedFolders == true> 
899                <input type="checkbox" class="interior-article-moreContent-checkbox" id="interior-article-moreContent-checkbox-${folderNb}" name="interior-article-moreContent-checkbox-${folderNb}"> 
900                <p class="interior-article-moreContent-title"><label for="interior-article-moreContent-checkbox-${folderNb}">${folderDescription}</label></p> 
901                <#assign folderNb = folderNb + 1 /> 
902            <#else> 
903                <p class="interior-article-moreContent-title">${folderDescription}</p> 
904            </#if> 
905        </#if> 
906         
907        <ul class="interior-article-moreContent-list"> 
908            <#local orderedDocs = getOrderedDocs(documents) /> 
909            <#list orderedDocs?reverse as docEntry> 
910                 
911                <#if !docEntry.isInTrash()> 
912                     
913                    <#local assetDocEntry = assetEntryLocalService.getEntry(docEntry.getGroupId(),docEntry.getUuid()) /> 
914                     
915                    <#if assetDocEntry.getAssetRenderer()??> 
916                     
917                        <#local linkedAssetRenderer = assetDocEntry.getAssetRenderer() /> 
918                         
919                        <#local assetLinkEntryTitle = assetDocEntry.getTitle(locale) /> 
920                        <#local assetLinkEntryDescription = assetDocEntry.getDescription(locale) /> 
921                        <#local extension = docEntry.getLatestFileVersion(true).getExtension() /> 
922                         
923                        <#local assetURL = linkedAssetRenderer.getURLDownload(themeDisplay) /> 
924                         
925                        <#local displaySize = "" /> 
926                        <#local size = docEntry.getLatestFileVersion(true).getSize() /> 
927                        <#if size/1024 < 1024 > 
928                            <#local formatSize = size/1024 /> 
929                            <#local displaySize = formatSize?round?string + " Ko" /> 
930                        <#else> 
931                            <#local formatSize = size/10485.76 /> 
932                            <#local displaySize = (formatSize?round/100)?string + " Mo" /> 
933                        </#if> 
934                         
935                        <#local extensionType = "" /> 
936                        <#switch extension> 
937                            <#case "pdf"> 
938                                <#local extensionType = "link-pdf" /> 
939                                <#break> 
940                            <#case "jpg"> 
941                                <#local extensionType = "link-img" /> 
942                                <#break> 
943                            <#case "png"> 
944                                <#local extensionType = "link-img" /> 
945                                <#break> 
946                            <#case "mp4"> 
947                                <#local extensionType = "link-video" /> 
948                                <#break> 
949                            <#case "swf"> 
950                                <#local extensionType = "link-flash" /> 
951                                <#break> 
952                            <#default> 
953                        </#switch> 
954                        <#assign dlFileEntry = docEntry.getLatestFileVersion(true)/> 
955                         
956                        <#local toDownload = "" /> 
957                        <#if assetLinkEntryTitle?contains("- téléchargement")> 
958                            <#local toDownload = "download" /> 
959                            <#if assetURL?contains("?version")> 
960                                <#local assetURL = assetURL + "&download=true" /> 
961                            <#else> 
962                                <#local assetURL = assetURL + "?download=true" /> 
963                            </#if> 
964                        </#if> 
965                         
966                        <#local target = " href='"+ assetURL +"'" /> 
967                         
968                        <li class="interior-article-moreContent" data-entry-id="${asset.entryId}"> 
969                            <a ${target} class="extension-${extension} ${extensionType}" title="${htmlUtil.escapeAttribute(assetLinkEntryDescription)}" ${toDownload} target="_blank" > 
970                                ${assetLinkEntryTitle} <span class="interior-article-moreContent-extension">${extension}</span> <span class="interior-article-moreContent-doc-weight">${displaySize}</span> <span class="interior-article-moreContent-aria">Ouvrir dans un nouvel onglet</span> 
971                            </a> 
972                        </li> 
973                         
974                    </#if> 
975                     
976                </#if> 
977                 
978            </#list> 
979        </ul> 
980         
981    </#list> 
982     
983</#macro> 
984 
985 
986<#function getOrderedAssets assets> 
987    <#local orderedAssets = [] /> 
988    <#local assetsWithDate = [] /> 
989    <#list assets as assetMap> 
990        <#local asset = assetMap.assetEntry /> 
991        <#local modifiedDate = asset.getModifiedDate() /> 
992        <#local assetsWithDate = assetsWithDate + [{'assetMap':assetMap,'modifiedDate':modifiedDate}] /> 
993    </#list> 
994    <#list assetsWithDate?sort_by('modifiedDate') as orderedAsset> 
995        <#local orderedAssets = orderedAssets + [orderedAsset.assetMap] /> 
996    </#list> 
997    <#return orderedAssets> 
998</#function> 
999 
1000<#function getOrderedDocs docs> 
1001    <#local orderedDocs = [] /> 
1002    <#local docsWithDate = [] /> 
1003    <#list docs as docMap> 
1004        <#local doc = assetEntryLocalService.getEntry(docMap.getGroupId(),docMap.getUuid()) /> 
1005        <#local modifiedDate = doc.getModifiedDate() /> 
1006        <#local docsWithDate = docsWithDate + [{'docMap':docMap,'modifiedDate':modifiedDate}] /> 
1007    </#list> 
1008    <#list docsWithDate?sort_by('modifiedDate') as orderedDoc> 
1009        <#local orderedDocs = orderedDocs + [orderedDoc.docMap] /> 
1010    </#list> 
1011    <#return orderedDocs> 
1012</#function> 
1013 
1014 
1015<#function isInternalLink link> 
1016  <#local internal = link?contains(".agglo-larochelle.fr") || !link?contains("//")> 
1017  <#return internal> 
1018</#function> 
1019 
1020 
1021<#function getField journalArticle fieldName> 
1022    <#local fieldValue = ''/> 
1023     <#local document = saxReaderUtil.read(journalArticle.getContent()) /> 
1024     <#local rootElement = document.getRootElement() /> 
1025     <#if (rootElement?? && rootElement?has_content)> 
1026        <#local xPathSelector =  saxReaderUtil.createXPath("dynamic-element[@name='"+fieldName+"']/dynamic-content") /> 
1027        <#if (validator.isNotNull(xPathSelector))> 
1028        <#local nbNodes = xPathSelector.selectNodes(rootElement)?size /> 
1029        <#if (nbNodes &gt; 0)> 
1030            <#local fieldValue = xPathSelector.selectSingleNode(rootElement).getStringValue() /> 
1031        </#if> 
1032     </#if> 
1033     <#return fieldValue /> 
1034     </#if> 
1035</#function>