1<!-- VIGNETTE ACTUALITE -->
2<#if entry?has_content>
3 <#-- Chargement de la variable de localisation -->
4 <#setting locale = locale />
5
6 <#-- Récupération de DateHelper pour le format date -->
7 <#assign dateHelperService = serviceLocator.findService("eu.strasbourg.utils.api.DateHelperService") />
8
9 <#-- Récupération de l'XML du contenu web -->
10 <#assign content = strasbourg.buildFieldValues(entry.getClassPK())/>
11
12 <#-- Champs concernant une actualité -->
13 <#assign title = content.title />
14 <#if !title?has_content><#assign title = entry.getTitle(locale) /></#if>
15 <#assign image = content.image />
16 <#assign assetPublisherTemplateHelperService = serviceLocator.findService("eu.strasbourg.utils.api.AssetPublisherTemplateHelperService")/>
17 <#assign imageURL ="" />
18 <#if image?has_content>
19 <#assign imageURL = image.contentUrl />
20 </#if>
21
22 <#-- Récupération de la Typologie -->
23 <#assign assetEntryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetEntryLocalService") />
24 <#assign assetVocabularyHelper = serviceLocator.findService("eu.strasbourg.utils.api.AssetVocabularyHelperService") />
25 <#assign asset = assetEntryLocalService.getEntry('com.liferay.journal.model.JournalArticle', entry.resourcePrimKey) >
26 <#assign typologiesList = assetVocabularyHelper.getAssetEntryCategoriesByVocabulary(asset, "typologie") />
27
28 <#-- Création de l'URL de détail -->
29 <#assign layoutHelper = serviceLocator.findService("eu.strasbourg.utils.api.LayoutHelperService") />
30 <#assign detailURL = layoutHelper.getJournalArticleLayoutURL(entry.groupId, entry.articleId, themeDisplay) />
31 <#if detailURL?has_content>
32 <a href="${detailURL}" class="searchable-item">
33
34 <figure class="fit-cover">
35 <img src="${imageURL}" width="1200" height="590" alt="Article image" />
36 </figure>
37
38 <div>
39 <div class="ops-cats">
40 <#list typologiesList as typology>
41 <span class="ops-cat">${typology.getTitle(locale)}</span>
42 </#list>
43 </div>
44 <h3>${title}</h3>
45 <span class="ops-basic-link"><@liferay_ui.message key="eu.ops.learn.more" /></span>
46 </div>
47
48
49
50
51 <script style="display: none" type="text/javascript">
52 $('document').ready(function(){
53 // Gestion dynamique des classes vis-à-vis de la position de l'élément
54 var item = $("a[href='${detailURL}']");
55 var itemIndex = $(".searchable-item").index(item);
56
57 if (itemIndex == 0) {
58 item.addClass("ops-card-article-highlight");
59 $('img', item).attr({'width':1200, 'height':590});
60 // Le premier titre est à mettre H2
61 $('h3', item).replaceWith(function () {
62 return "<h2>" + $(this).html() + "</h2>";
63 });
64 } else if (itemIndex < 3) {
65 item.addClass("ops-col-50");
66 $('img', item).attr({'width':580, 'height':265});
67 } else {
68 item.addClass("ops-col-25");
69 $('img', item).attr({'width':270, 'height':176});
70 }
71 });
72 </script>
73
74 </a>
75 </#if>
76
77</#if>