1<#assign journalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") />
2<#assign assetVocabularyLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetVocabularyLocalService") >
3<#assign assetCategoryLocalServiceUtil = staticUtil["com.liferay.asset.kernel.service.AssetCategoryLocalServiceUtil"]>
4<#assign journalArticleResourceLocalServiceUtil = serviceLocator.findService("com.liferay.journal.service.JournalArticleResourceLocalService") />
5
6
7<#assign groupId = themeDisplay.getScopeGroupId() />
8<#assign currentURL = themeDisplay.getURLCurrent() />
9
10<#if currentURL?contains("mi_vida") || currentURL?contains("mi-vida") >
11 <#assign
12 vocabularyName = "Blog Mi Vida"
13 />
14<#else>
15 <#assign
16 vocabularyName = "Blog Mi Negocio"
17 />
18</#if>
19
20<#assign assetVocabulary = assetVocabularyLocalService.fetchGroupVocabulary(groupId, vocabularyName) />
21
22<#-- En data-elemento-interacción no mostrará la sub-categoría y data-content-type porque la plantilla no dispone de dichos datos -->
23<#if titleFieldSet.getSiblings()?has_content>
24 <#list titleFieldSet.getSiblings() as cur_titleFieldSet>
25 <#if (cur_titleFieldSet.titleFieldSetFieldSet.linkButtonTextFieldSet.linkButtonTextFieldSetFieldSet.linkButtonLinkFieldSet.linkButtonLink.getData())??>
26 <#assign url = cur_titleFieldSet.titleFieldSetFieldSet.linkButtonTextFieldSet.linkButtonTextFieldSetFieldSet.linkButtonLinkFieldSet.linkButtonLink.getData() />
27 <#assign uriParts = url?split("/") />
28 <#assign lastPart = uriParts[uriParts?size - 1] />
29 <#assign friendlyURL = lastPart?split("?")[0] />
30
31 <#assign article = journalArticleLocalService.fetchArticleByUrlTitle(groupId, friendlyURL)>
32
33 <#if article??>
34 <#assign expandoBridge = article.getExpandoBridge()>
35 <#assign customAnalyticsProperties = expandoBridge.getAttribute("Campos Personalizados Analítica")>
36 <#assign articleId = article.articleId>
37
38 <#assign articleResourcePK = journalArticleResourceLocalServiceUtil.getArticleResourcePrimKey(groupId, articleId) />
39 <#assign categories = assetCategoryLocalServiceUtil.getCategories("com.liferay.journal.model.JournalArticle", articleResourcePK) />
40
41 <#list categories as category>
42 <#if (categories?size > 1) >
43 <#assign
44 assetVocabularyId = assetVocabulary.getVocabularyId()
45 categoryVocabularyId = category.getVocabularyId()
46 />
47
48 <#if assetVocabularyId == categoryVocabularyId>
49 <#assign
50 catTitle = category.getTitle(locale)
51 catId = category.categoryId
52 category = category.getTitle(locale)
53 />
54 </#if>
55 <#else>
56 <#assign
57 catTitle = category.getTitle(locale)
58 catId = category.categoryId
59 category = category.getTitle(locale)
60 />
61 </#if>
62 </#list>
63
64 <input type="hidden" class="analytics_view_content_articulos" data-elemento-interaccion="${catTitle} - ${cur_titleFieldSet.title.getData()}" data-content-id="${articleId}" data-content-type="${vocabularyName}" data-custom-properties='${customAnalyticsProperties}'>
65 </#if>
66 </#if>
67 </#list>
68</#if>
69
70<section class="media-carousel">
71 <div class="splide splide-big" aria-time="<#if (tiempo_de_rotacion.getData())??>${tiempo_de_rotacion.getData()}</#if>">
72 <div class="splide__track">
73 <ul class="splide__list">
74 <#if title.getSiblings()?has_content>
75 <#list title.getSiblings() as cur_title>
76
77 <#if cur_title.linkButtonText?? && cur_title.linkButtonText.getData()?has_content && cur_title.linkButtonText.getData() != '' && cur_title.linkButtonText.linkButtonLink?? && cur_title.linkButtonText.linkButtonLink.getData()?has_content && cur_title.linkButtonText.linkButtonLink.getData() != '' >
78 <#assign url = cur_title.linkButtonText.linkButtonLink.getData() />
79 <#assign uriParts = url?split("/") />
80 <#assign lastPart = uriParts[uriParts?size - 1] />
81 <#assign friendlyURL = lastPart?split("?")[0] />
82
83 <#assign article = journalArticleLocalService.fetchArticleByUrlTitle(groupId, friendlyURL)>
84
85 <#if article??>
86 <#assign expandoBridge = article.getExpandoBridge()>
87 <#assign customAnalyticsProperties = expandoBridge.getAttribute("Campos Personalizados Analítica")>
88 <#assign articleId = article.articleId>
89
90
91 <#assign articleResourcePK = journalArticleResourceLocalServiceUtil.getArticleResourcePrimKey(groupId, articleId) />
92 <#assign categories = assetCategoryLocalServiceUtil.getCategories("com.liferay.journal.model.JournalArticle", articleResourcePK) />
93
94 <#list categories as category>
95 <#if (categories?size > 1) >
96 <#assign
97 assetVocabularyId = assetVocabulary.getVocabularyId()
98 categoryVocabularyId = category.getVocabularyId()
99 />
100
101 <#if assetVocabularyId == categoryVocabularyId>
102 <#assign
103 catTitle = category.getTitle(locale)
104 catId = category.categoryId
105 />
106 </#if>
107 <#else>
108 <#assign
109 catTitle = category.getTitle(locale)
110 catId = category.categoryId
111 />
112 </#if>
113 </#list>
114 </#if>
115 </#if>
116 <li class="splide__slide">
117 <section class="media-slide">
118 <#if cur_title.background_image_desktop?? && cur_title.background_image_desktop.getData()?? && cur_title.background_image_desktop.getData() != "">
119 <picture class="media-slide__image">
120 <#if cur_title.background_image_mobile?? && cur_title.background_image_mobile.getData()?? && cur_title.background_image_mobile.getData() != "">
121 <source
122 media="(max-width: 1009px)"
123
124 srcset="${cur_title.background_image_mobile.getData()}"
125 />
126 </#if>
127 <img
128 loading="lazy"
129 src="${cur_title.background_image_desktop.getData()}"
130 alt=""
131 />
132 </picture>
133 </#if>
134 <#if cur_title.linkButtonText.isPlayVideo?? && cur_title.linkButtonText.isPlayVideo.getData()?? &&
135 getterUtil.getBoolean(cur_title.linkButtonText.isPlayVideo.getData())>
136 <video class="media-slide__video" autoplay="" loop="" muted="" playsinline="">
137 <#if cur_title.background_video_desktop?? && cur_title.background_video_desktop.getData()?? && cur_title.background_video_desktop.getData() != "">
138 <source src="${cur_title.background_video_desktop.getData()}" type="video/mp4" />
139 </#if>
140 <@liferay.language key="publicportals.carousel.video"/>
141 </video>
142 <video class="media-slide__video is-mobile" autoplay="" muted="" loop="" playsinline="">
143 <#if cur_title.background_video_mobile?? && cur_title.background_video_mobile.getData()?? && cur_title.background_video_mobile.getData() != "">
144 <source src="${cur_title.background_video_mobile.getData()}" type="video/mp4" />
145 </#if>
146 <@liferay.language key="publicportals.carousel.video"/>
147 </video>
148 </#if>
149
150 <div class="section-wrapper">
151 <#if (titleFieldSet.titleSize?? && titleFieldSet.titleSize.getData()?? && titleFieldSet.titleSize.getData() != "")>
152 <#assign titleSize = titleFieldSet.titleSize.getData() />
153 <#else>
154 <#assign titleSize = "h2" />
155 </#if>
156 <#if cur_title?? && cur_title.getData()?? && cur_title.getData() != "">
157 <${titleSize} class="media-slide__title">
158 ${cur_title.getData()}
159 </${titleSize}>
160 </#if>
161
162 <#if (titleFieldSet.titleFieldSetFieldSet.subtitleSize?? && titleFieldSet.titleFieldSetFieldSet.subtitleSize.getData()?? && titleFieldSet.titleFieldSetFieldSet.subtitleSize.getData() != "")>
163 <#assign subtitleSize = titleFieldSet.titleFieldSetFieldSet.subtitleSize.getData() />
164 <#else>
165 <#assign subtitleSize = "h3" />
166 </#if>
167 <#if cur_title.subtitle?? && cur_title.subtitle.getData()?? && cur_title.subtitle.getData() != "">
168 <${subtitleSize} class="media-slide__subtitle">
169 ${cur_title.subtitle.getData()}
170 </${subtitleSize}>
171 <#else>
172 <p class="media-slide__subtitle"></p>
173
174 </#if>
175 <#if cur_title.linkButtonText.isPlayVideo?? && cur_title.linkButtonText.isPlayVideo.getData()?? &&
176 getterUtil.getBoolean(cur_title.linkButtonText.isPlayVideo.getData())>
177 <#if cur_title.linkButtonText?? && cur_title.linkButtonText.getData()?has_content && cur_title.linkButtonText.getData()!='' >
178 <button class="button variant-contained color-red analytics_interaccion_boton" name="button" title="Reproduce el video" data-custom-properties='${customAnalyticsProperties}'>
179 <span class="button__text">${cur_title.linkButtonText.getData()}</span>
180 </button>
181 </#if>
182 <#else>
183 <#if cur_title.linkButtonText?? && cur_title.linkButtonText.getData()?has_content && cur_title.linkButtonText.getData()!='' && cur_title.linkButtonText.linkButtonLink?? && cur_title.linkButtonText.linkButtonLink.getData()?has_content && cur_title.linkButtonText.linkButtonLink.getData()!='' >
184 <#assign linkTarget = "_blank" />
185 <#if cur_title.linkButtonText.linkButtonLink.selectTarget?? && cur_title.linkButtonText.linkButtonLink.selectTarget.getData()?has_content>
186 <#assign linkTarget = cur_title.linkButtonText.linkButtonLink.selectTarget.getData() />
187 </#if>
188 <a class="button variant-contained color-red analytics_select_content_articulo"
189 href="${cur_title.linkButtonText.linkButtonLink.getData()}"
190 target="${linkTarget}"
191 onclick="checkWebviewLink(this, event)"
192 data-elemento-interaccion="${catTitle} - ${cur_title.getData()}"
193 data-content-type="${vocabularyName}"
194 data-content-id="${articleId}"
195 data-custom-properties='${customAnalyticsProperties}'
196 >
197 <span class="button__text">${cur_title.linkButtonText.getData()}</span>
198 </a>
199 </#if>
200 </#if>
201 </div>
202 </section>
203 </li>
204 </#list>
205 </#if>
206 </ul>
207 </div>
208 </div>
209</section>