1<#assign
2layouts = themeDisplay.getLayouts()
3local = themeDisplay.getLocale()
4layoutLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.LayoutLocalService")
5extendedSeq = []>
6<#-- set locale for freemarker date otherwise months are not translated in the current language -->
7<#setting locale= local>
8
9<#list layouts as mainpage>
10 <#if mainpage.getFriendlyURL(local) == '/business' &&
11 layout.getFriendlyURL(local)?starts_with('/business')>
12 <#list mainpage.getChildren() as homeSubPages>
13 <#if homeSubPages.getFriendlyURL(local) == '/business/blog'>
14 <#-- homeSubPages is blog homepage -->
15 <#list homeSubPages.getChildren() as articlesBlogPages>
16 <#if articlesBlogPages.getFriendlyURL(local) == '/business/blog/articles'>
17 <#list articlesBlogPages.getChildren() as categoriesBlogPages>
18 <#assign currentCategory = categoriesBlogPages
19 isArticleCategoryPage = false
20 isArticleSubcategoryPage = false>
21 <#list categoriesBlogPages.getChildren() as subCategoriesBlogPages>
22 <#assign currentSubCategory = subCategoriesBlogPages
23 listArticles = subCategoriesBlogPages.getChildren()>
24 <#if listArticles??>
25 <#list listArticles as articleElement>
26 <#assign dateArticle = articleElement.getExpandoBridge().getAttribute('Blog display date from')
27 authorPageUrl = articleElement.getExpandoBridge().getAttribute('Blog author page url')
28 authorTruncatedUrl = "/business" + authorPageUrl?keep_after("/business")
29 authorPage = layoutLocalService.getFriendlyURLLayout(groupId, false, authorTruncatedUrl)
30 authorImage = authorPage.getExpandoBridge().getAttribute('Blog image url')
31 articleImage = articleElement.getExpandoBridge().getAttribute('Blog image url')>
32 <#if authorPage.getFriendlyURL(local) == layout.getFriendlyURL(local)>
33 <#assign
34 <#-- insert the article required data inside the hash -->
35 articlePagesHash = {"date": dateArticle?datetime, "friendlyUrl": articleElement.getRegularURL(request),
36 "categoryName": currentCategory.getHTMLTitle(local), "categoryUrl": currentCategory.getRegularURL(request),
37 "subCategoryName": currentSubCategory.getHTMLTitle(local), "subCategoryUrl": currentSubCategory.getRegularURL(request),
38 "articleImage": articleImage, "articleTitle": articleElement.getHTMLTitle(local),
39 "articleDescription": articleElement.getDescription(local), "authorName": authorPage.getHTMLTitle(local),
40 "authorFriendlyUrl": authorPage.getRegularURL(request), "authorImage": authorImage}
41 extendedSeq += [articlePagesHash]>
42 </#if>
43 </#list>
44 </#if>
45 </#list>
46 </#list>
47 </#if>
48 </#list>
49 </#if>
50 </#list>
51 </#if>
52</#list>
53
54<#assign sortedListArticlePagesByDate = extendedSeq?sort_by("date")?reverse>
55
56<#if sortedListArticlePagesByDate?size != 0>
57 <section class="module module-cards-article" >
58 <div class="container">
59 <div class="row justify-content-center">
60 <div class="col-lg-12">
61
62 <div class="title-wrapper">
63 <h3 class="bottom-cut">${Title.getData()} ${layout.getHTMLTitle(local)}</h3>
64 </div>
65
66 <div class="content-list">
67 <div class="row">
68 <#list sortedListArticlePagesByDate as articles>
69 <div class="col-lg-4">
70 <div class="card card-article card-article-small">
71 <div class="card-wrapper">
72 <div>
73 <div class="card-img-wrapper">
74 <a data-senna-off="true" href="${articles.friendlyUrl}">
75 <img src="${articles.articleImage}" class="img-fluid object-fit" alt="">
76 </a>
77 </div>
78
79 <div class="card-text-wrapper">
80 <div class="badge-wrapper">
81 <a data-senna-off="true" href="${articles.categoryUrl}" class="badge badge-small badge-blue-business ">${articles.categoryName}</a>
82 <a data-senna-off="true" href="${articles.subCategoryUrl}" class="badge badge-small badge-blue-business ">${articles.subCategoryName}</a>
83 </div>
84
85 <h3><a data-senna-off="true" href="${articles.friendlyUrl}">${articles.articleTitle}</a></h3>
86 <p>${articles.articleDescription}</p>
87 </div>
88 </div>
89 <div>
90 <a data-senna-off="true" href="${articles.friendlyUrl}" class="btn btn-link"
91 <#if LinkLabel.LinkAriaLabel?? &&
92 LinkLabel.LinkAriaLabel?has_content &&
93 LinkLabel.LinkAriaLabel.getData()?has_content>
94 aria-label="${LinkLabel.LinkAriaLabel.getData()}"</#if>>
95 ${LinkLabel.getData()} <i class="icon-chevron-right"></i></a>
96 <div class="card-details-wrapper">
97 <div class="author">
98 <div class="author-img-wrapper">
99 <img src="${articles.authorImage}" class="img-fluid object-fit" alt="">
100 </div>
101 <div>
102 <p class="title">${AuthorLabel.getData()}</p>
103 <a data-senna-off="true" href="${articles.authorFriendlyUrl}"
104 class="value stretched-link"
105 <#if AuthorLabel.AuthorAriaLabel?? &&
106 AuthorLabel.AuthorAriaLabel?has_content &&
107 AuthorLabel.AuthorAriaLabel.getData()?has_content>
108 aria-label="${AuthorLabel.AuthorAriaLabel.getData()} ${articles.authorName}"</#if>>
109 ${articles.authorName}
110 </a>
111 </div>
112 </div>
113 <div class="date">
114 <p class="title">${PublicationLabel.getData()}</p>
115 <p class="value">${articles.date?string["dd MMMM yyyy"]}</p>
116 </div>
117 </div>
118 </div>
119 </div>
120 </div>
121 </div>
122 </#list>
123 </div>
124 </div>
125 </div>
126 </div>
127 </div>
128 </section>
129</#if>