1<#assign journalArticleService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")>
2<#if entries?has_content>
3 <div class="row text-break four-columns-services">
4 <#list entries as curEntry>
5 <#if curEntry.getAssetRenderer().getClassName() == "com.liferay.journal.model.JournalArticle">
6 <#assign article = journalArticleService.getLatestArticle(getterUtil.getLong(curEntry.getClassPK())) />
7 <#assign rootElement = saxReaderUtil.read(article.getContentByLocale(locale)).getRootElement() />
8 <#assign selectorImage = saxReaderUtil.createXPath("dynamic-element[@name='image']") />
9 <#assign image = "${themeDisplay.getPathThemeImages()}/images-default-contents.jpg" />
10 <#assign alt = "" />
11 <#if selectorImage.selectSingleNode(rootElement)?has_content>
12 <#assign rawImage = selectorImage.selectSingleNode(rootElement).getStringValue()?trim />
13 <#if rawImage != "" && rawImage != "{}">
14 <#assign imageJSON = rawImage?eval />
15 <#if imageJSON?has_content && imageJSON.groupId?has_content && imageJSON.fileEntryId?has_content && imageJSON.name?has_content && imageJSON.uuid?has_content>
16 <#assign image = "/documents/${imageJSON.groupId}/${imageJSON.fileEntryId}/${imageJSON.name}/${imageJSON.uuid}" />
17 </#if>
18 <#if imageJSON.alt?has_content>
19 <#assign alt = imageJSON.alt />
20 </#if>
21 </#if>
22 </#if>
23 <#assign viewURL = assetPublisherHelper.getAssetViewURL(renderRequest, renderResponse, curEntry.getAssetRenderer(), curEntry, !stringUtil.equals(assetLinkBehavior, "showFullContent")) />
24 <div class="d-none d-sm-block d-sm-6 d-md-block col-sm-6 col-lg-3 four-columns-services__item text-center">
25 <a href="${viewURL}">
26 <div class="aspect-ratio aspect-ratio-16-to-9 four-columns-services__item__image">
27 <#if alt == "">
28 <#assign alt = article.getTitle(locale) />
29 </#if>
30 <img src="${image}" alt="${alt}" class="aspect-ratio-item-center-middle aspect-ratio-item-fluid" />
31 </div>
32 </a>
33 <a href="${viewURL}" class="four-columns-services__item__link">
34 <h3>${article.getTitle(locale)}</h3>
35 </a>
36 <p>${article.getDescription(locale)}</p>
37 </div>
38 </#if>
39 </#list>
40 <#assign indicatorId = stringUtil.randomString() />
41 <div id="featured-carousel-indicators_${indicatorId}" class="d-block d-sm-none carousel slide carousel-services " data-ride="carousel" >
42
43 <div class="carousel-inner text-center">
44 <#list entries as curEntry>
45 <#if curEntry.getAssetRenderer().getClassName() == "com.liferay.journal.model.JournalArticle">
46 <#assign activeItem = "" />
47 <#if curEntry?is_first>
48 <#assign activeItem = "active" />
49 </#if>
50
51 <#assign article = journalArticleService.getLatestArticle(getterUtil.getLong(curEntry.getClassPK())) />
52 <#assign rootElement = saxReaderUtil.read(article.getContentByLocale(locale)).getRootElement() />
53 <#assign selectorImage = saxReaderUtil.createXPath("dynamic-element[@name='image']") />
54 <#assign image = "" />
55 <#assign alt = "" />
56 <#if selectorImage.selectSingleNode(rootElement)?has_content>
57 <#assign image = selectorImage.selectSingleNode(rootElement).getStringValue()?trim />
58 <#if image != "">
59 <#assign imageJSON = image?eval />
60 <#assign image = "/documents/${imageJSON.groupId}/${imageJSON.fileEntryId}/${imageJSON.name}/${imageJSON.uuid}" />
61 <#assign alt = imageJSON.alt />
62 </#if>
63 </#if>
64 <#if image == "">
65 <#assign image = "${themeDisplay.getPathThemeImages()}/images-default-contents.jpg" />
66 </#if>
67 <#assign viewURL = assetPublisherHelper.getAssetViewURL(renderRequest, renderResponse, curEntry.getAssetRenderer(), curEntry, !stringUtil.equals(assetLinkBehavior, "showFullContent")) />
68 <div class="carousel-item ${activeItem}">
69 <#if alt == "">
70 <#assign alt = article.getTitle(locale) />
71 </#if>
72 <a href="${viewURL}">
73 <div class="aspect-ratio aspect-ratio-16-to-9 four-columns-services__item__image">
74 <img alt="${alt}" src="${image}" class="aspect-ratio-item-center-middle aspect-ratio-item-fluid"/>
75 </div>
76 </a>
77
78 <a href="${viewURL}">
79 <h3>
80 ${article.getTitle()}
81 </h3>
82 </a>
83 <p>${article.getDescription(locale)}</p>
84 </div>
85 </#if>
86 </#list>
87 </div>
88 <ol class="carousel-indicators">
89 <#list 1..entries?size as i>
90 <#assign activeIndicator = "" />
91 <#if i?is_first>
92 <#assign activeIndicator = "active" />
93 </#if>
94 <li data-target="#featured-carousel-indicators_${indicatorId}" data-slide-to="${i-1}" class="${activeIndicator}"></li>
95 </#list>
96 </ol>
97 <a class="carousel-control-prev d-flex d-sm-none" href="#featured-carousel-indicators_${indicatorId}" role="button" data-slide="prev">
98 <span class="material-icons d-block d-sm-none "> keyboard_arrow_left </span>
99 <span class="sr-only">Previous</span>
100 </a>
101 <a class="carousel-control-next d-flex d-sm-none" href="#featured-carousel-indicators_${indicatorId}" role="button" data-slide="next">
102 <span class="material-icons d-block d-sm-none "> keyboard_arrow_right </span>
103 <span class="sr-only">Next</span>
104 </a>
105 </div>
106 </div>
107</#if>