1<#-- SERVICIOS -->
2<#assign DDLRecordLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.BaseLocalService")>
3<#assign layoutLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.LayoutLocalService")>
4<#-- <#assign serviceContext = staticUtil["com.liferay.portal.kernel.service.ServiceContextThreadLocal"].getServiceContext() /> -->
5
6<#assign urlEncoder = staticUtil["java.net.URLEncoder"]>
7
8<#-- servicios related asset subhome -->
9<#assign assetEntryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetEntryLocalService")>
10<#assign journalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")>
11<#assign journalArticleResourceLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleResourceLocalService")>
12
13
14<#-- VARIABLES -->
15<#assign articleId = .vars['reserved-article-id'].getData() >
16<#if request?has_content>
17 <#assign portletNamespace = themeDisplay.getPortletDisplay().getId() + '_' />
18 <#-- <#assign completeCurrentUrl = urlEncoder.encode((request["attributes"]["CURRENT_COMPLETE_URL"])?string?split("?")[0]?string, "UTF-8")> -->
19 <#assign completeCurrentUrl = urlEncoder.encode((themeDisplay.getPortalURL()+themeDisplay.getURLCurrent())?string?split("?")[0]?string, "UTF-8")>
20<#else>
21 <#assign portletNamespace = articleId + '_'>
22 <#assign completeCurrentUrl = 'http://www.bizkaia.eus'>
23</#if>
24
25<#assign articleTitle = .vars['reserved-article-title'].getData() >
26<#assign encodedTitle = urlEncoder.encode(articleTitle, "UTF-8")>
27
28<#-- <#assign themeDisplay = serviceContext.getThemeDisplay() /> -->
29<#assign layout = themeDisplay.getLayout() />
30
31<#-- obtener subhome enlazada como related assets -->
32<#assign journalArticleClassName = "com.liferay.journal.model.JournalArticle">
33
34<#assign introSubhomeStructureId = themeDisplay.getThemeSetting("structure-introsubhome-id") >
35
36<#assign reportajeArticle = journalArticleLocalService.getArticle(groupId, articleId) >
37<#assign reportajeEntry = assetEntryLocalService.getEntry(journalArticleClassName, reportajeArticle.getResourcePrimKey()) >
38
39<#assign assetEntryQuery = getAssetEntryQuery(reportajeEntry.getClassNameId(), getterUtil.getLong(introSubhomeStructureId), reportajeEntry.getEntryId(), "publishDate", "ASC")>
40<#assign entries = assetEntryLocalService.getEntries(assetEntryQuery)>
41
42<#-- recoger título, entradilla y color del contenido subhome relacionado-->
43<#assign colorSubhome ="#00e78d">
44<#assign tituloSubhome = "">
45<#assign entradillaSubhome ="">
46
47<#if 1 == entries?size>
48 <#list entries as e>
49 <#assign journalArticleResource = journalArticleResourceLocalService.fetchJournalArticleResource(getterUtil.getLong(e.getClassPK())) >
50 <#assign renderer = e.getAssetRenderer()>
51 <#assign subhomeArticle = renderer.getArticle() >
52 <#assign document = saxReaderUtil.read(subhomeArticle.getContentByLocale(locale)) >
53 <#assign rootElement = document.getRootElement() >
54 <#assign tituloSubhome = saxReaderUtil.createXPath("dynamic-element[@name='titulo']/dynamic-content").selectSingleNode(rootElement).getStringValue() >
55 <#assign entradillaSubhome = saxReaderUtil.createXPath("dynamic-element[@name='entradilla']/dynamic-content").selectSingleNode(rootElement).getStringValue() >
56 <#assign colorSubhome = saxReaderUtil.createXPath("dynamic-element[@name='color']/dynamic-content").selectSingleNode(rootElement).getStringValue() >
57 </#list>
58 <#else>
59</#if>
60
61<div class="top-reportaje">
62 <div class="container_fluid reportaje">
63 <div class="top-reportaje-img" style="background-image:url('${cabecera.imagenFondoCabecera.getData()}');">
64 <#-- <img src="${cabecera.imagenFondoCabecera.getData()}" alt=""> -->
65 </div>
66 <div class="bipo_overlay"></div>
67 <div class="top-reportaje-fondo-oscuro">
68 <div class="bipo_overlay"></div>
69 <div class="container">
70 <div class="row">
71 <div class="col-md-11 col-md-offset-1">
72 <hr class="cuadrado bgcolor">
73 </div>
74 </div>
75 </div>
76 </div>
77 <div class="reportaje-top-flecha">
78 <p><a href="#breadcrumb" id="flecha-arriba"><span class="iytuicon icon-skip-Video"></span> <span class="sr-only"><@liferay.language key="iytu.irContenido" /></span></a></p>
79 </div>
80 <div class="top-reportaje-texto">
81 <div class="container">
82 <div class="row">
83 <div class="col-sm-12 col-sm-offset-0 col-md-11 col-md-offset-1">
84 <div class="top-reportaje-titulo">
85 <h1>${articleTitle}</h1>
86 </div>
87 <div class="top-reportaje-entradilla">
88 <p class="subtitulo">${cabecera.entradilla.getData()}</p>
89 </div>
90 <#assign existeColumna2 = cabecera.introduccion2?? && cabecera.introduccion2.getData()?? && !stringUtil.equalsIgnoreCase("", cabecera.introduccion2.getData()) />
91 <div class="${existeColumna2?string('row', '')} top-reportaje-introduccion">
92 <#if existeColumna2 >
93 <div class="col-12 col-sm-6 col-md-6">
94 </#if>
95 ${appendTag(cabecera.introduccion.getData())}
96 <#if existeColumna2 >
97 </div>
98 <div class="col-12 col-sm-6 col-md-6">
99 ${appendTag(cabecera.introduccion2.getData())}
100 </div>
101 </#if>
102 </div>
103
104
105 <div class="top-reportaje-mapa">
106 <#if !stringUtil.equalsIgnoreCase("", cabecera.imagenSuperpuestaCabecera.getData()) >
107 <span class="top-reportaje-mapa-img"><img src="${cabecera.imagenSuperpuestaCabecera.getData()}" class="top-reportaje-mapa-img" alt=""></span>
108 </#if>
109 <div class="top-reportaje-mapa-texto">
110 <#if !stringUtil.equalsIgnoreCase("", tituloSubhome?string) >
111 <h2>${tituloSubhome}</h2>
112 </#if>
113 <#if !stringUtil.equalsIgnoreCase("", entradillaSubhome?string) >
114 <p>${entradillaSubhome}</p>
115 </#if>
116 </div>
117 </div>
118
119 </div>
120 </div>
121 </div>
122 <div class="clearfix"></div>
123 </div>
124
125 </div>
126</div>
127
128<script>
129$( document ).ready(function() {
130
131 $('.reportaje-top-flecha a').click(function(e) {
132 e.preventDefault();
133 var $target = $(this.hash);
134 var destino = this.hash;
135 $target = $target.length && $target || $(this.hash);
136 if ($target.length) {
137 var targetOffset = $target.offset().top;
138 var topSpace = $('#heading').height();
139 targetOffset = targetOffset - topSpace;
140 $('html,body').animate({scrollTop: targetOffset}, 1500);
141 }
142
143 });
144
145});
146</script>
147
148<#function getAssetEntryQuery classNameId structureId linkedAssetEntryId order orderType>
149 <#assign assetEntryQuery = objectUtil("com.liferay.asset.kernel.service.persistence.AssetEntryQuery") >
150
151 <#assign classNameIds = [classNameId] >
152 ${assetEntryQuery.setClassNameIds(classNameIds)}
153
154 <#if !stringUtil.equalsIgnoreCase("", structureId?string) >
155 <#assign classTypeIds = [structureId] >
156 ${assetEntryQuery.setClassTypeIds(classTypeIds)}
157
158 <#if !stringUtil.equalsIgnoreCase("", order) >
159 ${assetEntryQuery.setOrderByCol1(order)}
160 ${assetEntryQuery.setOrderByType1(orderType)}
161 </#if>
162 </#if>
163
164 <#if !stringUtil.equalsIgnoreCase("0", linkedAssetEntryId?string) >
165 ${assetEntryQuery.setLinkedAssetEntryIds([getterUtil.getLong(linkedAssetEntryId)])}
166 </#if>
167
168 <#return assetEntryQuery >
169</#function>
170<#function appendTag(element) >
171 <#if !(element?starts_with("<p>")||element?starts_with("<ul>")||element?starts_with("<ol>")||element?starts_with("<table>"))>
172 <#assign corrected = "<p>" + element >
173 <#else>
174 <#assign corrected = element >
175 </#if>
176
177 <#if !(element?ends_with("</p>")||element?ends_with("</ul>")||element?ends_with("</ol>")||element?ends_with("</table>"))>
178 <#assign corrected = corrected + "</p>">
179 </#if>
180
181 <#return corrected>
182</#function>