1<#if entries?has_content>
2 <#assign
3 journalArticleRetrievalService = digitalplace_journalArticleRetrievalService
4
5 journalArticleService = serviceLocator.findService("com.liferay.journal.service.JournalArticleService")
6
7 classNameService = serviceLocator.findService("com.liferay.portal.kernel.service.ClassNameService")
8
9 siteNavigationMenuItemLocalService = serviceLocator.findService("com.liferay.site.navigation.service.SiteNavigationMenuItemLocalService")
10
11 siteNavigationMenuItemHelper = digitalplace_siteNavigationMenuItemHelper
12
13 siteNavigationMenuClass = classNameService.fetchClassName("com.liferay.site.navigation.model.SiteNavigationMenu")
14
15 layoutPermission = serviceLocator.findService("com.liferay.portal.kernel.service.permission.LayoutPermission")
16 />
17
18 <div class="related-content-list-widget">
19
20 <#list entries as curEntry>
21
22 <#if siteNavigationMenuClass?has_content && curEntry.getClassNameId() == siteNavigationMenuClass.getClassNameId()>
23
24 <#assign menuEntries = siteNavigationMenuItemLocalService.getSiteNavigationMenuItems(curEntry.getClassPK(), 0) />
25
26 <#if menuEntries?has_content>
27 <#list menuEntries as navigationEntry>
28 <#assign siteNavigationMenuItemProperties = siteNavigationMenuItemHelper.getSiteNavigationMenuItemProperties(navigationEntry) />
29
30 <div>
31 <h2 class="supplement__heading">${siteNavigationMenuItemHelper.getMenuItemName(siteNavigationMenuItemProperties, themeDisplay)}</h2>
32
33 <ul class="related-assets-entries">
34 <#list siteNavigationMenuItemLocalService.getSiteNavigationMenuItems(curEntry.getClassPK(), navigationEntry.getSiteNavigationMenuItemId()) as childNavigationEntry>
35
36 <#assign childSiteNavigationMenuItemProperties = siteNavigationMenuItemHelper.getSiteNavigationMenuItemProperties(childNavigationEntry) />
37
38 <#if childNavigationEntry.getType() == "layout">
39 <#assign optionalLayout = siteNavigationMenuItemHelper.getMenuItemLayout(childNavigationEntry, childSiteNavigationMenuItemProperties) />
40
41 <#if optionalLayout.isPresent()>
42 <#assign layout = optionalLayout.get() />
43
44 <#if !layout.isHidden() && layoutPermission.contains(themeDisplay.getPermissionChecker(), layout.getPlid(), 'VIEW')>
45
46 <li class="related-asset-entry">
47 <a href="${layout.getRegularURL(request)}">${layout.getName(locale)}</a>
48 </li>
49 </#if>
50 </#if>
51 <#else>
52 <#assign childSiteNavigationUrl = siteNavigationMenuItemHelper.getMenuItemUrl(childNavigationEntry, childSiteNavigationMenuItemProperties, themeDisplay) />
53
54 <#if siteNavigationMenuItemHelper.isRedirectToCurrentWebsite(themeDisplay.getLayoutSet(), childSiteNavigationUrl)>
55 <#assign menuItemTarget = ""/>
56 <#else>
57 <#assign menuItemTarget = "_blank"/>
58 </#if>
59
60 <li class="related-asset-entry">
61 <a href="${childSiteNavigationUrl}" target="${menuItemTarget}">${siteNavigationMenuItemHelper.getMenuItemName(childSiteNavigationMenuItemProperties, themeDisplay)}</a>
62 </li>
63 </#if>
64 </#list>
65 </ul>
66 </div>
67 </#list>
68 </#if>
69 </#if>
70 </#list>
71 </div>
72</#if>