Blog
Se ha producido un error al procesar la plantilla.
The following has evaluated to null or missing: ==> deltaValue [in template "20097#20123#46382" at line 172, column 236] ---- Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: ${deltaValue + 6} [in template "20097#20123#46382" at line 172, column 234] ----
1<#setting locale="es_ES" />
2<#include "${fullTemplatesPath}/common/journal_article_util.ftl" />
3<#include "${fullTemplatesPath}/common/asset_entry_util.ftl" />
4
5<#attempt>
6
7 <#assign structureKey = "" />
8 <#if (request.getParameter("ddmstructurekey"))?? && request.getParameter("ddmstructurekey")!="">
9 <#assign structureKey = request.getParameter("ddmstructurekey") />
10 </#if>
11 <#recover>
12 </#attempt>
13
14
15 <div class="cyc-blogs container-fluid">
16 <#-- <#assign countArticles = journalArticleLocalService.getArticlesByStructureId(groupId, structureKey, 0, 0, 99, null)/>-->
17 <#if entries?has_content && structureKey?has_content >
18 <@initAssetEntryJournalArticlePortletVariables/>
19
20 <#assign lastArticleId='0'/>
21
22 <#attempt>
23 <#assign categoryKey ='' />
24 <#if (request.getParameter("category"))?? && request.getParameter("category")!="">
25 <#assign categoryKey = request.getParameter("category") />
26 </#if>
27 <#recover>
28 </#attempt>
29
30 <#attempt>
31 <#if (request.getParameter("delta"))?? && request.getParameter("delta")!="">
32 <#assign deltaValue = request.getParameter("delta")?number/>
33 </#if>
34
35 <#recover>
36 <#assign deltaValue = 7 />
37 </#attempt>
38
39 <#assign newDeltaValue = deltaValue+6 />
40
41 <#if categoryKey == ''>
42 <#--solo se obtiene lastarticle en caso de existir busqueda (sin categorias), en cuyo caso no debe repetirse el item de la cabecera con un resultado-->
43 <#assign lastArticleId = freemarkerUtilLocalService.getLastJournalArticlePublishedIdByStructureKey(themeDisplay.getScopeGroupId(),structureKey) />
44 </#if>
45
46 <#assign itemsPrinted = 0 />
47
48
49 <!--INICIO ORDENA TODO POR LAS FECHAS ESTA LISTA-->
50 <#assign entriesWithDetails = []>
51 <#list entries as entry>
52 <@initAssetEntryJournalArticleItemVariables entry/>
53 <#assign date = currentEntryJournalArticle.displayDate?datetime />
54 <#-- Add entry details to the array -->
55 <#assign entryDetails = {
56 "entry": entry,
57 "date": date,
58 "url": entry.getViewURL()
59 }>
60 <#assign entriesWithDetails = entriesWithDetails + [entryDetails]>
61 </#list>
62 <#assign sortedEntries = entriesWithDetails?sort_by(["date"])>
63 <#assign reversedEntries = sortedEntries?reverse>
64
65 <div class="cyc-blogs container-fluid">
66 <div class="row results">
67 <#list reversedEntries as item>
68 <@initAssetEntryJournalArticleItemVariables item.entry/>
69 <!--FIN ORDENA TODO POR LAS FECHAS ESTA LISTA HASTA AQUI-->
70 <#assign imagen = getImagenFromJournalArticle(currentEntryJournalArticle,docArticle,"frontPage")/>
71 <#assign title = getFieldFromJournalArticle(currentEntryJournalArticle,docArticle,"title")/>
72 <#assign text1 = getFieldFromJournalArticle(currentEntryJournalArticle,docArticle,"text1")/>
73
74 <#assign entradilla = text1?replace('<[^>]+>','','r')/>
75 <#assign intro = text1?index_of(' ', 150)/>
76 <#-- se obtiene siempre un valor de mas xq es probable que el elemento de la cabecera venga en el listado y no queremos repetir -->
77 <#-- si lastArticle valor no deberia pintarse-->
78 <#if itemsPrinted < (deltaValue?number)-1 && lastArticleId != currentEntryJournalArticleId >
79 <#assign itemsPrinted = itemsPrinted+1 />
80
81 <div class="col-12 col-md-4">
82 <div class="card">
83 <a href="${item.entry.getViewURL()}">
84 <#if imagen.url?has_content>
85 <div class="image-container">
86 <img src="${imagen.url}" alt="${imagen.alt}" class="image-item"/>
87 </div>
88 </#if>
89 </a>
90
91 <div class="card-body">
92 <#if currentEntryCategoryList?has_content>
93 <#assign x=0/>
94 <div class="categories d-flex flex-row">
95
96 <#list currentEntryCategoryList as category>
97 <#if x lt 3>
98 <div>${category.getName()}</div>
99 <#assign x++/>
100 <#else>
101 <#break>
102 </#if>
103 </#list>
104 </div>
105 </#if>
106 <div class="title">
107 <a href="${item.entry.getViewURL()}">
108 ${currentEntryJournalArticle.getTitle()}
109 </a>
110 </div>
111 <div class="content">
112 ${currentEntryJournalArticle.displayDate?string["dd MMM. yyyy"]} - ${entradilla[0..intro]}...
113 </div>
114 <a href="${item.entry.getViewURL()}">
115 <i class="cyc-icon-arrow"/>
116 </a>
117 </div>
118 </div>
119
120 </div>
121
122 </#if>
123 </#list>
124
125 <#--se termina de llenar el espacio en blanco con al menos una columna para pintar lineas negras-->
126 <#if !(((itemsPrinted?number) % 3)==0) >
127 <div class="col-12 col-md-4"></div>
128 </#if>
129
130 </div>
131
132 <#-- si se han obtenido tantos elemetnos como hemos solicitado es probable que existan más y se pinta el boton -->
133 <#if (itemsPrinted?number)== (deltaValue?number)-1 >
134
135 <div class="row load-more-row">
136 <div class="col-md-4 d-none d-md-block"></div>
137 <div class="col-12 col-md-4">
138 <a class="cyc-btn" id="load-more"
139 href=""
140 >
141 Cargar más</a>
142 </div>
143 </div>
144 <div class="col-md-4 d-none d-md-block"></div>
145 </div>
146 </#if>
147
148 </#if>
149
150 </div>
151
152 <script>
153
154 AUI().ready(function () {
155 var values = window.location.search;
156
157 var urlParams = new URLSearchParams(values);
158 var left = urlParams.get("left");
159 var top = urlParams.get("top");
160 const btnLoadMore = document.getElementById('load-more');
161 const posicion = btnLoadMore.getBoundingClientRect();
162 const desplazamientoX = window.pageXOffset || document.documentElement.scrollLeft;
163 const desplazamientoY = window.pageYOffset || document.documentElement.scrollTop;
164 const posicionX = posicion.left + desplazamientoX;
165 const posicionY = posicion.top + desplazamientoY;
166
167
168 window.scrollTo(left,top);
169 btnLoadMore.addEventListener('click', function(event) {
170 event.preventDefault();
171 if(urlParams.get("category") != null){
172 url = url + "?ddmstructurekey=" + urlParams.get("ddmstructurekey") + "&delta=" + ${deltaValue + 6} + "&category=" + urlParams.get("category") + "&left=" + posicionX + "&top=" + posicionY;
173 }else{
174 url = url + "?ddmstructurekey=" + urlParams.get("ddmstructurekey") + "&delta=" + ${deltaValue + 6} + "&left=" + posicionX + "&top=" + posicionY;
175 }
176
177 window.location.href = url;
178 });
179
180 });
181
182
183
184
185 </script>