1<div class="container">
2 <#if entries?has_content>
3 <#list entries?chunk(3) as row>
4 <div class="row border-left">
5 <#list row as curEntry>
6 <#assign viewURL = assetPublisherHelper.getAssetViewURL(renderRequest, renderResponse, curEntry.getAssetRenderer(), curEntry, !stringUtil.equals(assetLinkBehavior, "showFullContent")) />
7 <#assign viewURL = viewURL?replace("?"+viewURL?split("?")[1], "")>
8 <#assign journalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") />
9 <#assign article = journalArticleLocalService.fetchLatestArticle(curEntry.getClassPK()) />
10 <#assign aArticleXML = saxReaderUtil.read(article.getContentByLocale(locale)) />
11 <#assign title = article.getTitle(locale) />
12 <#assign tituloDestacado = aArticleXML.valueOf("//dynamic-element[@name='tituloDestacado']/dynamic-content") />
13 <#assign autores = aArticleXML.selectNodes("//dynamic-element[@name='autor']/dynamic-content") />
14 <#assign imagenArticulo = aArticleXML.valueOf("//dynamic-element[@name='imagen']/dynamic-content/text()") />
15 <#assign detalle = aArticleXML.valueOf("//dynamic-element[@name='detalle']/dynamic-content") />
16
17 <#assign assetCategoryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService")/>
18 <#assign assetVocabularyLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetVocabularyLocalService") />
19 <#assign categoriesList = assetCategoryLocalService.getCategories("com.liferay.journal.model.JournalArticle", article.getResourcePrimKey())/>
20 <#assign vocabularyTemaName = "Tema" />
21 <#assign vocabularyNRevistaName = "Nº de revista" />
22 <#assign vocabularyTopicName = "Topic" />
23 <#assign avoidTopic = "PRINCIPAL" />
24
25 <#-- Featured Image of the Article -->
26 <#assign featuredImage = article.getArticleImageURL(themeDisplay)!""/>
27
28 <div class="col-md border-right">
29 <article class="article article-small">
30 <figure class="media">
31 <picture>
32 <#-- show featuredImage if set. -->
33 <#if featuredImage?has_content>
34 <img src="${featuredImage}" />
35 <#else>
36 <#if imagenArticulo?? && imagenArticulo?has_content>
37 <#attempt>
38 <#assign jsonObject = imagenArticulo?eval/>
39 <#assign entryUuid = jsonObject.uuid />
40 <#assign entryGroupId = getterUtil.getLong(jsonObject.groupId) />
41 <#assign entryAlt = jsonObject.alt />
42 <#assign dlFileEntryLocalService = serviceLocator.findService("com.liferay.document.library.kernel.service.DLFileEntryLocalService") />
43 <#assign assetEntryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetEntryLocalService")>
44 <#assign dlFileEntry = dlFileEntryLocalService.getDLFileEntryByUuidAndGroupId(entryUuid, entryGroupId) />
45 <#assign assetEntry = assetEntryLocalService.getEntry("com.liferay.document.library.kernel.model.DLFileEntry", dlFileEntry.fileEntryId) />
46 <#assign assetRenderer = assetEntry.assetRenderer />
47 <#assign imagen = assetRenderer.getURLDownload(themeDisplay) />
48 <img alt="${entryAlt}" data-fileentryid="${dlFileEntry.fileEntryId}" src="${imagen}" />
49 <#recover>
50 </#attempt>
51 </#if>
52 </#if>
53 </picture>
54 </figure>
55
56 <#if categoriesList?has_content>
57 <#list categoriesList as category>
58 <#assign categoryVocabulary = assetVocabularyLocalService.getAssetVocabulary(category.getVocabularyId()) />
59 <#if categoryVocabulary.getName() == vocabularyNRevistaName>
60 <#assign revista_number = category.getTitle(locale)/>
61 </#if>
62 </#list>
63 </#if>
64 <p class="kicker">
65 <#if categoriesList?has_content>
66 <#list categoriesList as category>
67 <#assign categoryVocabulary = assetVocabularyLocalService.getAssetVocabulary(category.getVocabularyId()) />
68 <#if categoryVocabulary.getName() == vocabularyTemaName>
69 <a title="${category.getTitle(locale)}">${category.getTitle(locale)}</a>
70 </#if>
71 </#list>
72 <a title="${revista_number}">${revista_number}</a>
73 <#list categoriesList as category>
74 <#assign categoryVocabulary = assetVocabularyLocalService.getAssetVocabulary(category.getVocabularyId()) />
75 <#if categoryVocabulary.getName() == vocabularyTopicName && category.getTitle(locale) != avoidTopic>
76 <a title="${category.getTitle(locale)}">${category.getTitle(locale)}</a>
77 </#if>
78 </#list>
79 </#if>
80 </p>
81
82 <h2 class="title title-standard">
83 <a href="${viewURL}" title="${title}">${title}</a>
84 </h2>
85
86 <p class="meta">
87 <#assign fecha = dateUtil.getDate(article.getDisplayDate(), "d 'de' MMMM 'de' yyyy", locale) />
88 <#if fecha?has_content>
89 <span>${fecha}</span>
90 </#if>
91
92 <#assign tiempo = "" />
93 <#if detalle?has_content>
94 <#assign content = detalle?trim />
95 <#if content != "">
96 <#assign contentCount = content?replace("<[^>]+>", "", "r")?word_list?size />
97 <#if contentCount gt 0>
98 <#assign minutesValue = (contentCount/200)?round />
99 <#if minutesValue == 0>
100 <#assign tiempo = "Unos segundos" />
101 <#elseif minutesValue == 1>
102 <#assign tiempo = minutesValue + " minuto" />
103 <#else>
104 <#assign tiempo = minutesValue + " minutos" />
105 </#if>
106 </#if>
107 </#if>
108 </#if>
109 <#if tiempo?? && tiempo != "">
110 <span><i class="fa fa-regular fa-clock"></i> ${tiempo}</span>
111 </#if>
112 </p>
113
114 <p class="author">
115 <#if autores?has_content>
116 <#list autores as autor>
117 <#assign aArticleXMLAutores = saxReaderUtil.read(autor.getParent().asXML()) />
118 <#assign autorJournalArticle = aArticleXMLAutores.valueOf("//dynamic-element[@name='autor']/dynamic-content") />
119 <#attempt>
120 <#assign jsonObject = autorJournalArticle?eval/>
121 <#assign articleClassPK = jsonObject.classPK />
122 <#assign articleGroupId = getterUtil.getLong(jsonObject.groupId) />
123 <#assign articleAutor = journalArticleLocalService.fetchLatestArticle(articleClassPK?number)>
124 <#assign aArticleXMLAutor = saxReaderUtil.read(articleAutor.getContentByLocale(locale)) />
125 <#assign nombre = aArticleXMLAutor.valueOf("//dynamic-element[@name='nombre']/dynamic-content/text()") />
126 <#assign apellidos = aArticleXMLAutor.valueOf("//dynamic-element[@name='apellidos']/dynamic-content/text()") />
127 <a title="${nombre} ${apellidos}">${nombre} ${apellidos}</a>
128 <#recover>
129 </#attempt>
130 </#list>
131 </#if>
132 </p>
133 </article>
134 </div>
135 </#list>
136 </div>
137 </#list>
138 </#if>
139</div>
140<style>
141
142 @media (max-width: 769px){
143 .col-md.border-right {
144 border-right: none !important;
145}
146@media (max-width: 769px){
147 .row.border-left {
148 border-left: none !important;
149 }
150}
151
152
153</style>