1<#if umcg_library_path??><#import umcg_library_path as umcg_library /></#if>
2
3<div class="facilities-list-result overview-list-result" id="overview-list-result">
4 <#if entries?has_content>
5 <ul>
6 <#list entries as curEntry>
7 <#assign
8 image = {}
9 raw_image = ''
10 image_alt = ''
11 image_url = ''
12 renderer = curEntry.getAssetRenderer()
13 className = renderer.getClassName()
14 title = curEntry.getTitle(locale)
15 url = curEntry.getAssetRenderer().getURLViewInContext(renderRequest, renderResponse, currentURL)
16 fileEntryId = ''
17 />
18
19 <#assign article = renderer.getArticle() />
20 <#assign document = saxReaderUtil.read(article.getContentByLocale(locale.toString()) ) />
21 <#assign rootElement = document.getRootElement() />
22
23 <#assign xPathSelector = saxReaderUtil.createXPath("//dynamic-element[@name='Teaser']") />
24 <#assign teaser_node = (xPathSelector.selectSingleNode(rootElement))! />
25
26 <#assign xPathSelector = saxReaderUtil.createXPath("//dynamic-element[@name='TeaserTitle']") />
27 <#assign teaser_title = (xPathSelector.selectSingleNode(teaser_node).getStringValue())!'NO TEASER TITLE!' />
28
29 <#assign xPathSelector = saxReaderUtil.createXPath("//dynamic-element[@name='TeaserText']") />
30 <#assign teaser_text = (xPathSelector.selectSingleNode(teaser_node).getStringValue())!'NO TEASER TEXT!' />
31
32 <#assign xPathSelector = saxReaderUtil.createXPath("//dynamic-element[@name='TeaserImage']") />
33 <#assign raw_image = ((xPathSelector.selectSingleNode(teaser_node).getStringValue())?trim)!'' />
34
35 <#if raw_image?has_content>
36 <#assign raw_image = raw_image?eval/>
37 <#assign fileEntryId = (raw_image.fileEntryId) />
38 <#if fileEntryId?has_content>
39 <#assign image_url = umcgContentService.getImageUrl((fileEntryId!0)?number)/>
40 </#if>
41 <#assign image_alt = (raw_image.alt)!'' />
42 </#if>
43
44 <#if className?contains("com.liferay.journal.model.JournalArticle") >
45 <#assign image = {
46 'image': image_url!'',
47 'alt': image_alt!''} />
48
49 <#if fileEntryId?has_content>
50 <#assign image = image + {
51 'file_id': fileEntryId} />
52 </#if>
53 </#if>
54
55 <#assign combinedText = teaser_title?length + teaser_text?length>
56
57 <#if teaser_title?length gt 112>
58 <#assign teaser_title = teaser_title?substring(0, 112) + '…' />
59 </#if>
60 <#if teaser_title?length gt 112 && teaser_text?length gt 133>
61 <#assign teaser_title = teaser_title?substring(0, 112) + '…' />
62 <#assign teaser_text = teaser_text?substring(0, 83) + '…' />
63 </#if>
64 <#if teaser_text?length gt 175 && teaser_title?length gt 75>
65 <#assign teaser_text = teaser_text?substring(0, 133) + '…' />
66 <#elseif teaser_text?length gt 175>
67 <#assign teaser_text = teaser_text?substring(0, 133) + '…' />
68 </#if>
69
70 <#if teaser_title?length lt teaser_text?length && combinedText?length gt 250>
71 <#assign teaser_text = teaser_text?substring(0, 133) + '…'>
72 </#if>
73
74 <li>
75 <@umcg_library.facilities_list_item
76 url=url
77 title=teaser_title
78 text=teaser_text
79 image=image
80 />
81
82 </li>
83 </#list>
84 </ul>
85 </#if>
86</div>