1<#--
2 Se usa para mostrar el detalle de un proyecto
3 -->
4
5
6<#assign AssetCategoryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService")>
7<#assign JournalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")>
8<#assign AssetEntryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetEntryLocalService")>
9<#assign AssetVocabularyLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetVocabularyLocalService")>
10<#assign AssetLinkLocalService = serviceLocator.findService("com.liferay.asset.link.service.AssetLinkLocalService")>
11
12<#assign statusApproved = 0>
13<#assign journalArticle = JournalArticleLocalService.fetchLatestArticle(groupId, reserved\-article\-id.data, statusApproved)>
14<#assign assetEntry = AssetEntryLocalService.getEntry("com.liferay.journal.model.JournalArticle", journalArticle.getResourcePrimKey())>
15<#assign categories = AssetCategoryLocalService.getEntryCategories(assetEntry.getEntryId())>
16
17
18<#assign VOC_TIPO_PROYECTO = "SACYR_GLOBAL_TIPO_PROYECTO">
19<#assign VOC_TIPO_PROYECTO_INNOVACION = "SACYR_GLOBAL_TIPO_PROYECTO_INNOVACION">
20<#assign VOC_TAG = "SACYR_VOC_TAGS">
21<#assign STR_PAIS = "SACYR_GLOBAL_STR_PAIS">
22
23
24<#assign currentUrl = themeDisplay.getPortalURL() + themeDisplay.getURLCurrent() />
25
26<#assign allEntries = [] />
27
28<#-- Se añade la home -->
29<#assign site_default_url = htmlUtil.escape(themeDisplay.getLayout().getGroup().getDisplayURL(themeDisplay, false)) />
30<#assign site_name = htmlUtil.escape(themeDisplay.getLayout().getGroup().getDescriptiveName()) />
31<#assign allEntries = allEntries + [{'name' : site_name, 'url' : site_default_url }] />
32
33<#-- Se añaden las paginas intermedias -->
34<#assign entries = themeDisplay.getLayout().getAncestors()?reverse />
35<#list entries as itemLayout>
36 <#assign allEntries = allEntries + [{'name' : itemLayout.getName(locale), 'url' : portalUtil.getLayoutFriendlyURL(itemLayout, themeDisplay) }] />
37</#list>
38
39<#-- Se añade la propia pagina -->
40<#assign allEntries = allEntries + [{'name' : titulo.getData(), 'url' : currentUrl }] />
41
42<div class="container">
43 <div class="breadcrumbs-rrss-container breadcrumbs-rrss-container-project">
44 <div class="breadcrumbs-blog">
45 <#-- Pinto los elementos del breadcrumb -->
46 <#assign position = 1>
47 <#list allEntries as item>
48 <#if item?is_last >
49 <span>${item.name}</span>
50 <#else>
51 <a href="${item.url}">${item.name}</a>
52 </#if>
53 <#assign position++>
54 </#list>
55 </div>
56 <div class="text-share-rrss text-right">
57 <span class="text text-blue hidden-xs hidden-sm">${languageUtil.get(locale, "share")}:</span>
58 <ul class="share-social js-share-social">
59 <li><a class="facebook" href="" onclick="window.open('http://www.facebook.com/sharer.php?u=${currentUrl}', '${titulo.getData()}', 'width=600,height=400'); return false;" aria-label="Compartir en Facebook"><span class="icon-sm-facebook"></span></a></li>
60 <li><a class="twitter" href="" onclick="window.open('https://twitter.com/intent/tweet?text=${titulo.getData()}&tw_p=tweetbutton&url=${currentUrl}', '${titulo.getData()}', 'width=600,height=400'); return false;" aria-label="Compartir en Twitter"><span class="icon-sm-twitter"></span></a></li>
61 <li><a class="linkedin" href="" onclick="window.open('http://www.linkedin.com/shareArticle?&title=${titulo.getData()}&mini=true&url=${currentUrl}&summary=', '${titulo.getData()}', 'width=600,height=400'); return false;" aria-label="Compartir en Linkedin"><span class="icon-sm-linkedin"></span></a></li>
62 </ul>
63 </div>
64 </div>
65</div>
66
67<#-- Seccion proyecto -->
68<div class="container">
69 <div class="detail-info">
70 <div class="categories-list">
71 <ul>
72 <#list categories as cat>
73 <#assign voc = AssetVocabularyLocalService.getAssetVocabulary(cat.getVocabularyId())>
74 <#if voc.getName()?lower_case == VOC_TIPO_PROYECTO?lower_case || voc.getName()?lower_case == VOC_TIPO_PROYECTO_INNOVACION?lower_case>
75 <li class="bg-yellow">${cat.getTitle(locale)}</li>
76 <#break>
77 </#if>
78 </#list>
79 </ul>
80 </div>
81 <#-- Titulo -->
82 <h1 class="title">${titulo.getData()}</h1>
83 <div class="subtitle">
84 ${entradilla.getData()}
85 </div>
86
87 <#-- Imagen -->
88 <div class="main-img-description">
89
90 <#if codigoVideo.getData()?? && codigoVideo.getData() != "" && imagenDesktop.getData()?? && imagenDesktop.getData() != "">
91 <button class="multimedia-video js-multimedia-video" aria-label="Play video" style="width:100%; height:100%">
92 <span class="icon icon-play-b-ig"></span>
93 <#if imagenDesktop.getData()?? && imagenDesktop.getData() != "">
94 <img alt="${imagenDesktop.getAttribute("alt")}" data-fileentryid="${imagenDesktop.getAttribute("fileEntryId")}" src="${imagenDesktop.getData()}" />
95 </#if>
96 </button>
97 <iframe src="${codigoVideo.getData()}" width="100%" height="640" class="hide" frameborder="0"
98 allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
99 allowfullscreen></iframe>
100 <#elseif codigoVideo.getData()?? && codigoVideo.getData() != "">
101 <iframe src="${codigoVideo.getData()}" width="100%" height="640" frameborder="0"
102 allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
103 allowfullscreen></iframe>
104 <#else>
105 <#if imagenMobile.getData()?? && imagenMobile.getData() != "">
106 <img class="img-mobile" alt="${imagenMobile.getAttribute("alt")}" data-fileentryid="${imagenMobile.getAttribute("fileEntryId")}" src="${imagenMobile.getData()}" />
107 </#if>
108 <#if imagenDesktop.getData()?? && imagenDesktop.getData() != "">
109 <img class="img-desktop" alt="${imagenDesktop.getAttribute("alt")}" data-fileentryid="${imagenDesktop.getAttribute("fileEntryId")}" src="${imagenDesktop.getData()}" />
110 </#if>
111 </#if>
112
113
114 <#if pie?? && pie.getData()?? && pie.getData() != "">
115 <div class="description">
116 <p>${pie.getData()}</p>
117 </div>
118 </#if>
119 </div>
120 <#-- Sección 2 -->
121 <div class="main-content">
122 <div class="row">
123 <#if icono.getData()?? && icono.getData() != "">
124 <div class="col-sm-2-5 hidden-xs">
125 <div class="label-box">
126 <img alt="${icono.getAttribute("alt")}" data-fileentryid="${icono.getAttribute("fileEntryId")}" src="${icono.getData()}" />
127 <p class="text">${autor.getData()}</p>
128 <#assign fecha_Data = getterUtil.getString(fecha.getData())>
129
130 <#if validator.isNotNull(fecha_Data)>
131 <#assign fecha_DateObj = dateUtil.parseDate("yyyy-MM-dd", fecha_Data, locale)>
132 <p class="date">${dateUtil.getDate(fecha_DateObj, "dd/MM/yyyy", locale)}</p>
133 </#if>
134 </div>
135 </div>
136 <div class="col-sm-7">
137 <#else>
138 <div class="col-sm-7">
139 </#if>
140 <#-- Contenido -->
141 <div class="main-text">
142 <div class="text">
143 ${texto.getData()}
144 </div>
145 </div>
146 </div>
147 <#-- Tags + Pais -->
148 <div class="col-sm-2-5 hidden-xs">
149 <ul class="badges-list">
150 <#-- Ver la definicion de la macro (más abajo) -->
151 <@tagsPais/>
152 </ul>
153 </div>
154 </div>
155 </div>
156 </div>
157 </div>
158</div>
159
160<#-- Contenidos relacionados del detalle, cada contenido relacionado se pinta con su template -->
161<div>
162 <#if elementos.getSiblings()?has_content>
163 <#list elementos.getSiblings() as cur_elementosDetalle>
164 <#if cur_elementosDetalle?? && cur_elementosDetalle.getData() != "">
165 <#assign data = cur_elementosDetalle.getData()?eval>
166 <#if data?? && data?has_content >
167 <#assign ja = JournalArticleLocalService.fetchLatestArticle(data["classPK"]?number)>
168 <div class="my-info-detail-components">
169 ${JournalArticleLocalService.getArticleContent(ja, ja.getDDMTemplateKey(), "VIEW", locale, null, themeDisplay)}
170 </div>
171 </#if>
172 </#if>
173 </#list>
174 </#if>
175</div>
176
177<div class="container">
178 <div class="row">
179 <div class="col-sm-7">
180 <div class="download-item-share-links-group">
181 <#-- Boton de descargar imagenes, entiendo que se refiere a la imagen de la Noticia-->
182 <div class="download-item text-left">
183 <#-- Se solicita quitar la descarga de la imagen
184 <a href="${imagenDesktop.getData()}&download=true" class="btn download-btn">
185 <span class="icon"></span>
186 <span class="text">${languageUtil.get(locale, "download")} ${languageUtil.get(locale, "images")?lower_case}</span>
187 </a>
188 -->
189 </div>
190 <#-- Compartir en Redes sociales parte inferior -->
191 <div class="text-share-rrss">
192 <span class="text text-blue">${languageUtil.get(locale, "share")}:</span>
193 <ul>
194 <li><a class="facebook" href="" onclick="window.open('http://www.facebook.com/sharer.php?u=${currentUrl}', '${titulo.getData()}', 'width=600,height=400'); return false;" aria-label="Compartir en Facebook"><span class="icon-sm-facebook"></span></a></li>
195 <li><a class="twitter" href="" onclick="window.open('https://twitter.com/intent/tweet?text=${titulo.getData()}&tw_p=tweetbutton&url=${currentUrl}', '${titulo.getData()}', 'width=600,height=400'); return false;" aria-label="Compartir en Twitter"><span class="icon-sm-twitter"></span></a></li>
196 <li><a class="linkedin" href="" onclick="window.open('http://www.linkedin.com/shareArticle?&title=${titulo.getData()}&mini=true&url=${currentUrl}&summary=', '${titulo.getData()}', 'width=600,height=400'); return false;" aria-label="Compartir en Linkedin"><span class="icon-sm-linkedin"></span></a></li>
197 </ul>
198 </div>
199 </div>
200 </div>
201 </div>
202</div>
203
204<#-- Tags + Pais parte inferior -->
205<div class="container">
206 <div class="row">
207 <div class="col-sm-7 col-sm-2-5-offset">
208 <ul class="badges-list badges-list--margin-bottom inline">
209 <@tagsPais/>
210 </ul>
211 </div>
212 </div>
213</div>
214
215<#function getFieldValue fieldName rootElement>
216 <#if fieldName?contains(".")>
217 <#assign rootElementName = fieldName?split(".")?first >
218 <#assign xPathSelector = saxReaderUtil.createXPath("dynamic-element[@name='${rootElementName}']") >
219 <#return getFieldValue(fieldName?remove_beginning("${rootElementName}."), xPathSelector.selectSingleNode(rootElement)) >
220 </#if>
221 <#assign xPathSelector = saxReaderUtil.createXPath("dynamic-element[@name='${fieldName}']") >
222 <#return xPathSelector.selectSingleNode(rootElement).getStringValue() >
223</#function>
224
225<#macro tagsPais>
226 <#list categories as cat>
227 <#assign voc = AssetVocabularyLocalService.getAssetVocabulary(cat.getVocabularyId())>
228 <#if voc.getName()?lower_case == VOC_TAG?lower_case>
229 <li><span class="badge bg-darkblue"><span class="icon-tag"></span>${cat.getTitle(locale)}</span></li>
230 </#if>
231 </#list>
232 <#assign assetLinks = AssetLinkLocalService.getDirectLinks(assetEntry.getEntryId())>
233 <#-- Pais -->
234 <#list assetLinks as al>
235 <#assign relatedAsset = AssetEntryLocalService.getEntry(al.getEntryId2())>
236 <#assign relatedJournal = JournalArticleLocalService.fetchLatestArticle(relatedAsset.getClassPK(), 0) >
237 <#if relatedJournal?? && relatedJournal.getDDMStructure().getName(locale) == STR_PAIS>
238 <#assign rootElement = saxReaderUtil.read(relatedJournal.getContentByLocale(locale)).getRootElement()>
239 <li><span class="badge bg-yellow"><span class="icon-location"></span>${getFieldValue("nombre", rootElement)}</span></li>
240 <#break>
241 </#if>
242 </#list>
243</#macro>
244
245
246<#assign contextUrl = themeDisplay.getPortalURL() />
247<#assign currentArticle = JournalArticleLocalService.getArticle(groupId, .vars['reserved-article-id'].data) />
248<#assign site_name_public = "Sacyr Proyecto" />
249<#assign twitter_account = "@SomosSacyr" />
250
251<@liferay_util["html-top"] outputKey="htmltop" >
252
253 <meta property="og:title" content="${titulo.getData()}">
254 <meta property="og:type" content="article">
255
256 <#if imagenDesktop.getData()?? && imagenDesktop.getData() != "">
257 <meta property="og:image" content="${imagenDesktop.getData()}">
258 </#if>
259
260 <meta property="og:site_name" content="${site_name_public}">
261 <meta property="og:description" content="${entradilla.getData()?replace('<[^>]+>','','r')?replace("\"", "'")}">
262
263 <meta property="article:published_time" content="${currentArticle.getDisplayDate()?datetime?iso_utc}">
264 <meta property="article:modified_time" content="${currentArticle.getModifiedDate()?datetime?iso_utc}">
265
266 <meta name="twitter:card" content="summary_large_image">
267 <meta name="twitter:site" content="${twitter_account}">
268 <meta name="twitter:domain" content="${portalUtil.getCanonicalURL(themeDisplay.getPortalURL(), themeDisplay, null)}">
269 <meta name="twitter:title" content="${titulo.getData()}">
270 <meta name="twitter:description" content="${entradilla.getData()?replace('<[^>]+>','','r')?replace("\"", "'")}">
271
272 <#if imagenDesktop.getData()?? && imagenDesktop.getData() != "">
273 <meta name="twitter:image" content="${imagenDesktop.getData()}">
274 </#if>
275
276 <#-- Pinto el marcado enriquecido para el SEO -->
277 <#assign position=1>
278 <script type="application/ld+json">
279 {
280 "@context": "http://schema.org",
281 "@type": "BreadcrumbList",
282 "itemListElement": [
283 <#list allEntries as item>
284 {
285 "@type": "ListItem",
286 "position": ${position},
287 "item": {
288 "@id": "${item.url}",
289 "name": "${item.name}"
290 }
291 <#if position < allEntries?size>
292 },
293 <#else>
294 }
295 </#if>
296 <#assign position=position+1>
297 </#list>
298 ]}
299 </script>
300
301</@>