S'ha produït un error mentre es processava la plantilla.
For "#if" condition: Expected a boolean, but this has evaluated to a number (wrapper: f.t.SimpleNumber):
==> hora [in template "20115#20151#535839" at line 328, column 18]
----
FTL stack trace ("~" means nesting-related):
- Failed at: #if hora [in template "20115#20151#535839" at line 328, column 13]
----
1<#-- =========================================================================
2 PLANTILLA: NOTA / CONVOCATÒRIA
3
4 COMPATIBILITAT:
5 - Liferay DXP Q1.2025.14
6 - Liferay DXP Q1.25
7
8 INDEPENDÈNCIA DEL SITE:
9 La plantilla no depèn de themeDisplay.getScopeGroupId() ni recupera
10 continguts a partir del groupId del site actual.
11
12 Treballa amb els camps que Liferay proporciona directament al context
13 del contingut que s'està renderitzant.
14
15 ADAPTACIONS PRINCIPALS:
16 1. Camps Select compatibles entre Q1.14 i Q1.25:
17 - primer getData()
18 - fallback a getOptions()
19
20 2. Imatge:
21 - no es depèn de getName() per recuperar alineacio/grandaria
22 - s'accedeix directament als camps
23 - evita classes incorrectes com "100"
24
25 3. Elements relacionats:
26 - es cerquen els camps fills mitjançant getFieldReference()
27 - getName() queda només com a fallback per compatibilitat
28 - els <li> utilitzen clearfix per evitar problemes de float
29 amb els botons a Q1.14
30============================================================================ -->
31
32
33<#-- =========================================================================
34 FUNCIONS AUXILIARS
35============================================================================ -->
36
37
38<#-- Recupera el valor d'un camp Select.
39 Q1.14: habitualment getData().
40 Q1.25: getData() pot retornar buit o [] i es prova getOptions().
41-->
42<#function getSelectValue field>
43
44 <#if !field??>
45 <#return "">
46 </#if>
47
48 <#assign value = field.getData()!"" />
49
50 <#if value?has_content && value != "[]">
51
52 <#return value
53 ?replace("[", "")
54 ?replace("]", "")
55 ?replace("\"", "")
56 ?trim
57 >
58
59 </#if>
60
61 <#attempt>
62
63 <#assign options = field.getOptions() />
64
65 <#if options?has_content>
66
67 <#return options[0]
68 ?string
69 ?replace("[", "")
70 ?replace("]", "")
71 ?replace("\"", "")
72 ?trim
73 >
74
75 </#if>
76
77 <#recover>
78 </#attempt>
79
80 <#return "">
81
82</#function>
83
84
85<#-- Recupera getData() d'un camp fill cercant-lo pel fieldReference.
86 A Q1.25 els noms interns poden ser generats, per tant no depenem
87 exclusivament de getName().
88-->
89<#function getChildData parentField fieldReference>
90
91 <#assign result = "" />
92
93 <#if parentField??>
94
95 <#attempt>
96
97 <#list parentField.getChildren() as childField>
98
99 <#assign childReference = "" />
100
101 <#attempt>
102
103 <#assign childReference =
104 childField.getFieldReference()!""
105 />
106
107 <#recover>
108 </#attempt>
109
110
111 <#-- Fallback per compatibilitat amb Q1.14 / formats antics -->
112 <#if !childReference?has_content>
113
114 <#assign childReference =
115 childField.getName()!""
116 />
117
118 </#if>
119
120
121 <#if childReference == fieldReference>
122
123 <#assign result =
124 childField.getData()!""
125 />
126
127 </#if>
128
129 </#list>
130
131 <#recover>
132 </#attempt>
133
134 </#if>
135
136 <#return result>
137
138</#function>
139
140
141<#-- Recupera el Friendly URL d'un camp fill de tipus pàgina. -->
142<#function getChildFriendlyUrl parentField fieldReference>
143
144 <#assign result = "" />
145
146 <#if parentField??>
147
148 <#attempt>
149
150 <#list parentField.getChildren() as childField>
151
152 <#assign childReference = "" />
153
154 <#attempt>
155
156 <#assign childReference =
157 childField.getFieldReference()!""
158 />
159
160 <#recover>
161 </#attempt>
162
163
164 <#-- Fallback per Q1.14 / formats antics -->
165 <#if !childReference?has_content>
166
167 <#assign childReference =
168 childField.getName()!""
169 />
170
171 </#if>
172
173
174 <#if childReference == fieldReference>
175
176 <#attempt>
177
178 <#assign result =
179 childField.getFriendlyUrl()!""
180 />
181
182 <#recover>
183 </#attempt>
184
185 </#if>
186
187 </#list>
188
189 <#recover>
190 </#attempt>
191
192 </#if>
193
194 <#return result>
195
196</#function>
197
198
199<#-- =========================================================================
200 DADES GENERALS
201============================================================================ -->
202
203<#assign titol =
204 .vars["reserved-article-title"].getData()!""
205/>
206
207<#assign etq_descarrega =
208 languageUtil.get(locale, "descarrega")
209/>
210
211<#assign etq_visita =
212 languageUtil.get(locale, "visita")
213/>
214
215<#assign etq_inf_rel =
216 languageUtil.get(locale, "informacio-relacionada")
217/>
218
219
220<#-- =========================================================================
221 TIPUS DE MARC
222============================================================================ -->
223
224<#assign tipusMarcValue = "" />
225
226<#if tipusMarc??>
227
228 <#assign tipusMarcValue =
229 getSelectValue(tipusMarc)
230 />
231
232</#if>
233
234
235<#if tipusMarcValue == "box-flow">
236
237 <#assign capsa = "box-flow" />
238
239<#elseif tipusMarcValue == "box-muted">
240
241 <#assign capsa = "box-muted" />
242
243<#else>
244
245 <#assign capsa = "box-flow" />
246
247</#if>
248
249
250<div class="${capsa} mb-xs-regular mb-md-large">
251
252
253 <#-- =====================================================================
254 TÍTOL
255 ====================================================================== -->
256
257 <#if mostraTitol??
258 && getterUtil.getBoolean(
259 mostraTitol.getData()!false
260 )>
261
262 <div class="heading-wrapper">
263
264 <h3 class="heading">
265 ${titol}
266 </h3>
267
268 </div>
269
270 </#if>
271
272
273 <#-- =====================================================================
274 DATA I HORA
275 ====================================================================== -->
276
277 <#assign data = "" />
278 <#assign hora = "" />
279 <#assign minut = "" />
280
281 <#assign la_barra = " / " />
282 <#assign la_h = " h" />
283
284
285 <#if Data??>
286
287 <#assign Data_Data =
288 getterUtil.getString(
289 Data.getData()
290 )
291 />
292
293 <#else>
294
295 <#assign Data_Data = "" />
296
297 </#if>
298
299
300 <#if validator.isNotNull(Data_Data)>
301
302
303 <#assign Data_DateObj =
304 dateUtil.parseDate(
305 "yyyy-MM-dd",
306 Data_Data,
307 locale
308 )
309 />
310
311
312 <#assign data =
313 dateUtil.getDate(
314 Data_DateObj,
315 "dd-MM-yyyy",
316 locale
317 )
318 />
319
320
321 <#if Hora??
322 && (Hora.getData()!"")?has_content>
323
324 <#assign hora =
325 Hora.getData()?number
326 />
327
328 <#if hora >= 0 && hora < 24>
329
330 <#assign hora =
331 hora?left_pad(2, "0")
332 />
333
334 </#if>
335
336 </#if>
337
338
339 <#if Hora??
340 && (Hora.getData()!"")?has_content
341 && Minut??
342 && (Minut.getData()!"")?has_content>
343
344 <#assign minut =
345 Minut.getData()?number
346 />
347
348 <#if minut >= 0 && minut < 59>
349
350 <#if locale == "ca_ES">
351
352 <#assign minut =
353 "." + minut?left_pad(2, "0")
354 />
355
356 <#else>
357
358 <#assign minut =
359 ":" + minut?left_pad(2, "0")
360 />
361
362 </#if>
363
364 </#if>
365
366 </#if>
367
368
369 <#if hora?has_content
370 && minut?has_content>
371
372 <#assign hora =
373 la_barra + hora + minut + la_h
374 />
375
376 <#else>
377
378 <#assign hora = "" />
379
380 </#if>
381
382
383 <p>
384 ${data!""} ${hora!""}
385 </p>
386
387
388 </#if>
389
390
391 <#-- =====================================================================
392 IMATGE I CONTINGUT
393 ====================================================================== -->
394
395 <#if contingut??
396 && (contingut.getData()!"")?has_content
397 && imatge??
398 && (imatge.getData()!"")?has_content>
399
400
401 <#-- Valors per defecte vàlids -->
402 <#assign col_img = "col-md-12" />
403 <#assign col_txt = "col-md-12" />
404
405 <#assign col_img_anterior = "" />
406 <#assign col_img_posterior = "" />
407
408 <#assign alineacio = "d" />
409 <#assign grandaria = "100" />
410
411
412 <#-- =================================================================
413 ALINEACIÓ DE LA IMATGE
414
415 e = esquerra
416 c = centrada
417 d = dreta
418 ================================================================== -->
419
420 <#if imatge.alineacio??>
421
422 <#assign alineacioValue =
423 getSelectValue(
424 imatge.alineacio
425 )
426 />
427
428
429 <#if alineacioValue == "e">
430
431 <#assign alineacio = "e" />
432
433 <#elseif alineacioValue == "c">
434
435 <#assign alineacio = "c" />
436
437 <#else>
438
439 <#assign alineacio = "d" />
440
441 </#if>
442
443 </#if>
444
445
446 <#-- =================================================================
447 GRANDÀRIA DE LA IMATGE
448 ================================================================== -->
449
450 <#if imatge.grandaria??>
451
452 <#assign grandariaValue =
453 getSelectValue(
454 imatge.grandaria
455 )
456 />
457
458 <#if grandariaValue?has_content>
459
460 <#assign grandaria =
461 grandariaValue
462 />
463
464 </#if>
465
466 </#if>
467
468
469 <#-- =================================================================
470 CÀLCUL DE COLUMNES
471 ================================================================== -->
472
473 <#if alineacio != "c">
474
475
476 <#if grandaria == "25">
477
478 <#assign col_img = "col-md-3" />
479 <#assign col_txt = "col-md-9" />
480
481
482 <#elseif grandaria == "50">
483
484 <#assign col_img = "col-md-6" />
485 <#assign col_txt = "col-md-6" />
486
487
488 <#elseif grandaria == "75">
489
490 <#assign col_img = "col-md-9" />
491 <#assign col_txt = "col-md-3" />
492
493
494 <#elseif grandaria == "100">
495
496 <#assign col_img = "col-md-12" />
497 <#assign col_txt = "col-md-0" />
498
499
500 </#if>
501
502
503 <#else>
504
505
506 <#if grandaria == "25"
507 || grandaria == "50">
508
509 <#assign col_img_anterior = "col-md-3" />
510 <#assign col_img = "col-md-6" />
511 <#assign col_img_posterior = "col-md-3" />
512 <#assign col_txt = "col-md-0" />
513
514
515 <#elseif grandaria == "75"
516 || grandaria == "100">
517
518 <#assign col_img = "col-md-12" />
519 <#assign col_txt = "col-md-0" />
520
521
522 </#if>
523
524
525 </#if>
526
527
528 <#-- =================================================================
529 DADES DE LA IMATGE
530 ================================================================== -->
531
532 <#assign img_src =
533 imatge.getData()!""
534 />
535
536 <#assign img_alt =
537 imatge.getAttribute("alt")!""
538 />
539
540
541 <#-- =================================================================
542 IMATGE AL 100%
543 ================================================================== -->
544
545 <#if col_img == "col-md-12">
546
547
548 <div class="row">
549
550 <div class="col-xs-12 col-md-12">
551
552 <img
553 src="${htmlUtil.escapeAttribute(img_src)}"
554 alt="${htmlUtil.escapeAttribute(img_alt)}"
555 >
556
557 </div>
558
559 </div>
560
561
562 <div class="row">
563
564 <div class="col-xs-12 col-md-12">
565
566 ${contingut.getData()}
567
568 </div>
569
570 </div>
571
572
573 <#else>
574
575
576 <#-- =============================================================
577 ALINEACIÓ ESQUERRA
578 ============================================================== -->
579
580 <#if alineacio == "e">
581
582
583 <div class="row">
584
585 <div class="col-xs-12 ${col_img}">
586
587 <img
588 src="${htmlUtil.escapeAttribute(img_src)}"
589 alt="${htmlUtil.escapeAttribute(img_alt)}"
590 >
591
592 </div>
593
594
595 <div class="col-xs-12 ${col_txt}">
596
597 ${contingut.getData()}
598
599 </div>
600
601 </div>
602
603
604 <#-- =============================================================
605 ALINEACIÓ DRETA
606 ============================================================== -->
607
608 <#elseif alineacio == "d">
609
610
611 <div class="row">
612
613 <div class="col-xs-12 ${col_txt}">
614
615 ${contingut.getData()}
616
617 </div>
618
619
620 <div class="col-xs-12 ${col_img}">
621
622 <img
623 src="${htmlUtil.escapeAttribute(img_src)}"
624 alt="${htmlUtil.escapeAttribute(img_alt)}"
625 >
626
627 </div>
628
629 </div>
630
631
632 <#-- =============================================================
633 ALINEACIÓ CENTRADA
634 ============================================================== -->
635
636 <#else>
637
638
639 <div class="row">
640
641
642 <div class="col-xs-12 ${col_img_anterior}">
643 </div>
644
645
646 <div class="col-xs-12 ${col_img}">
647
648 <img
649 src="${htmlUtil.escapeAttribute(img_src)}"
650 alt="${htmlUtil.escapeAttribute(img_alt)}"
651 >
652
653 </div>
654
655
656 <div class="col-xs-12 ${col_img_posterior}">
657 </div>
658
659
660 </div>
661
662
663 <div class="row">
664
665 <div class="col-xs-12 col-md-12">
666
667 ${contingut.getData()}
668
669 </div>
670
671 </div>
672
673
674 </#if>
675
676
677 </#if>
678
679
680 <#-- =====================================================================
681 NOMÉS CONTINGUT, SENSE IMATGE
682 ====================================================================== -->
683
684 <#elseif contingut??
685 && (contingut.getData()!"")?has_content>
686
687
688 <div class="row">
689
690 <div class="col-xs-12 col-md-12">
691
692 ${contingut.getData()}
693
694 </div>
695
696 </div>
697
698
699 </#if>
700
701
702 <#-- =====================================================================
703 ELEMENTS RELACIONATS
704
705 Compatible Q1.14 / Q1.25.
706
707 Els camps fills no es recuperen depenent únicament del getName().
708 Es prioritza getFieldReference().
709
710 També s'afegeix clearfix a cada <li> perquè els botons flotats
711 pel tema no afectin visualment els elements següents.
712 ====================================================================== -->
713
714
715 <#assign hiHaER = false />
716
717
718 <#if ElementRelacionat??
719 && ElementRelacionat.getSiblings()?has_content>
720
721
722 <#list ElementRelacionat.getSiblings() as cur_ElementRelacionat>
723
724
725 <#assign fet = false />
726
727 <#assign titolElement =
728 cur_ElementRelacionat.getData()!""
729 />
730
731
732 <#-- =============================================================
733 RECUPERACIÓ DELS CAMPS FILLS
734 ============================================================== -->
735
736 <#assign documentRelacionatValue =
737 getChildData(
738 cur_ElementRelacionat,
739 "documentRelacionat"
740 )
741 />
742
743
744 <#assign paginaRelacionadaValue =
745 getChildFriendlyUrl(
746 cur_ElementRelacionat,
747 "paginaRelacionada"
748 )
749 />
750
751
752 <#assign urlValue =
753 getChildData(
754 cur_ElementRelacionat,
755 "URL"
756 )
757 />
758
759
760 <#-- =============================================================
761 OBERTURA DEL BLOC
762 ============================================================== -->
763
764 <#if titolElement?has_content>
765
766
767 <#if !hiHaER>
768
769
770 <div
771 class="extras extrasInclos"
772 style="margin-top: 30px"
773 >
774
775
776 <h4 class="heading mt-xs-0">
777 ${etq_inf_rel}
778 </h4>
779
780
781 <ul>
782
783
784 </#if>
785
786
787 <#assign hiHaER = true />
788
789
790 <#-- =========================================================
791 DOCUMENT RELACIONAT
792 ========================================================== -->
793
794 <#if !fet
795 && documentRelacionatValue?has_content>
796
797
798 <li class="clearfix">
799
800
801 <h4>
802 ${titolElement}
803 </h4>
804
805
806 <a
807 class="btn btn-primary-o"
808 href="${htmlUtil.escapeAttribute(documentRelacionatValue)}"
809 target="_blank"
810 rel="noopener noreferrer"
811 >
812
813 <i class="icon icon-download"></i>
814
815 <span>
816 ${etq_descarrega}
817 </span>
818
819 </a>
820
821
822 </li>
823
824
825 <#assign fet = true />
826
827
828 </#if>
829
830
831 <#-- =========================================================
832 PÀGINA RELACIONADA
833 ========================================================== -->
834
835 <#if !fet
836 && paginaRelacionadaValue?has_content>
837
838
839 <li class="clearfix">
840
841
842 <h4>
843 ${titolElement}
844 </h4>
845
846
847 <a
848 class="btn btn-primary-o"
849 href="${htmlUtil.escapeAttribute(paginaRelacionadaValue)}"
850 target="_blank"
851 rel="noopener noreferrer"
852 >
853
854 <i class="icon icon-open"></i>
855
856 <span>
857 ${etq_visita}
858 </span>
859
860 </a>
861
862
863 </li>
864
865
866 <#assign fet = true />
867
868
869 </#if>
870
871
872 <#-- =========================================================
873 URL
874 ========================================================== -->
875
876 <#if !fet
877 && urlValue?has_content>
878
879
880 <li class="clearfix">
881
882
883 <h4>
884 ${titolElement}
885 </h4>
886
887
888 <a
889 class="btn btn-primary-o"
890 href="${htmlUtil.escapeAttribute(urlValue)}"
891 target="_blank"
892 rel="noopener noreferrer"
893 >
894
895 <i class="icon icon-open"></i>
896
897 <span>
898 ${etq_visita}
899 </span>
900
901 </a>
902
903
904 </li>
905
906
907 <#assign fet = true />
908
909
910 </#if>
911
912
913 </#if>
914
915
916 </#list>
917
918
919 </#if>
920
921
922 <#-- =====================================================================
923 TANCAMENT DEL BLOC D'INFORMACIÓ RELACIONADA
924 ====================================================================== -->
925
926 <#if hiHaER>
927
928 </ul>
929
930 </div>
931
932 </#if>
933
934
935</div>