1<#--
2Widget templates can be used to modify the look of a
3specific application.
4
5Please use the left panel to quickly add commonly used variables.
6Autocomplete is also available and can be invoked by typing "${".
7-->
8
9<#assign siteUrl = themeDisplay.getScopeGroup().getFriendlyURL()>
10<#assign pageURL = themeDisplay.getLayout().getFriendlyURL()>
11<#assign pageTitle = themeDisplay.getLayout().getHTMLTitle(locale)>
12<#assign productsPageUrl = propsUtil.get("products-page-url-"+themeDisplay.getLanguageId())>
13
14<#assign countryCode = locale.getCountry()?lower_case>
15
16<#assign groupId = themeDisplay.getCompanyGroupId() />
17<#assign languageId = themeDisplay.getLanguageId() />
18
19<#if countryCode == "mx">
20 <#assign vocabularyName = "product categories mx" />
21<#else>
22 <#assign vocabularyName = "product categories" />
23</#if>
24
25<#assign listAssetCategory =
26 restClient.get(
27 "/bap-common-headless-service/v1.0/product-nav/categories" +
28 "?groupId=${groupId}" +
29 "&vocabularyName=${vocabularyName}" +
30 "&languageId=${languageId}"
31 ).items
32/>
33
34
35<#assign layoutLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.LayoutLocalService")>
36
37<#assign productLayout = layoutLocalService.fetchLayoutByFriendlyURL(themeDisplay.getScopeGroupId(), false, productsPageUrl)>
38<#assign productLayoutName = productLayout.getHTMLTitle(locale)>
39
40<#assign homeLayout = layoutLocalService.fetchLayoutByFriendlyURL(themeDisplay.getScopeGroupId(), false, "/home")>
41<#assign homeLayoutName = homeLayout.getHTMLTitle(locale)>
42
43<div class="container">
44 <div class="row">
45<ol class="breadcrumb bap-breadcrumb-wrapper">
46 <li class="breadcrumb-item">
47 <a class="breadcrumb-link" href="${htmlUtil.escape(layout.getGroup().getDisplayURL(themeDisplay, false))}" title="${homeLayoutName}">
48 <span class="breadcrumb-text-truncate">${homeLayoutName}</span>
49 </a>
50 </li>
51 <li class="breadcrumb-item">
52 <#if pageURL == productsPageUrl>
53 <span class="breadcrumb-text-truncate">${productLayoutName}</span>
54 <#else>
55 <a class="breadcrumb-link" href="${productsPageUrl}" title="${productLayoutName}">
56 <span class="breadcrumb-text-truncate ">${productLayoutName}</span>
57 </a>
58 </#if>
59 </li>
60 <#list listAssetCategory as assetCategory>
61 <#if assetCategory.parentCategoryId == 0 && assetCategory.name == pageTitle >
62 <li class="breadcrumb-item">
63
64 <span class="breadcrumb-text-truncate">${htmlUtil.escape(assetCategory.name)}</span>
65
66 </li>
67 </#if>
68 <#if assetCategory.parentCategoryId == 0 && !pageURL?contains("/"+assetCategory.url) >
69
70
71 <#list listAssetCategory as childAssetCategory>
72
73 <#if childAssetCategory.parentCategoryId == assetCategory.categoryId && pageURL?contains("/"+childAssetCategory.url)>
74
75 <li class="breadcrumb-item">
76 <a class="breadcrumb-link" href="${assetCategory.url!""}" title="${htmlUtil.escape(assetCategory.name)}">
77 <span class="breadcrumb-text-truncate">${htmlUtil.escape(assetCategory.name)}</span>
78 </a>
79 </li>
80
81 <li class="breadcrumb-item">
82
83 <span class="breadcrumb-text-truncate">${htmlUtil.escape(childAssetCategory.name)}</span>
84
85 </li>
86 </#if>
87 </#list>
88 </#if>
89</#list>
90</ol>
91</div>
92</div>