You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by dk...@apache.org on 2019/12/19 21:09:58 UTC

[sling-org-apache-sling-app-cms] 11/17: AEM-7900 side breadcrumb example working

This is an automated email from the ASF dual-hosted git repository.

dklco pushed a commit to branch SLING-7900
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-app-cms.git

commit 99b2d39727c93897732bc0c6bbbb63d91aca4535
Author: JE Bailey <ja...@sas.com>
AuthorDate: Mon Sep 17 13:28:12 2018 -0400

    AEM-7900 side breadcrumb example working
---
 .../java/org/apache/sling/cms/core/models/components/Breadcrumbs.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/core/src/main/java/org/apache/sling/cms/core/models/components/Breadcrumbs.java b/core/src/main/java/org/apache/sling/cms/core/models/components/Breadcrumbs.java
index 0d2f8fa..71b7075 100644
--- a/core/src/main/java/org/apache/sling/cms/core/models/components/Breadcrumbs.java
+++ b/core/src/main/java/org/apache/sling/cms/core/models/components/Breadcrumbs.java
@@ -25,7 +25,6 @@ import javax.inject.Inject;
 import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ValueMap;
-import org.apache.sling.cms.core.models.BaseModel;
 import org.apache.sling.models.annotations.Default;
 import org.apache.sling.models.annotations.DefaultInjectionStrategy;
 import org.apache.sling.models.annotations.Model;
@@ -63,10 +62,11 @@ public class Breadcrumbs {
     @PostConstruct
     public void postConstruct() {
         suffixResource = slingRequest.getRequestPathInfo().getSuffixResource();
+        String prefix = slingRequest.getRequestURI();
+        prefix = prefix.split(suffixResource.getPath())[0];
         if (suffixResource == null) {
             return;
         }
-        String prefix = slingRequest.getPathInfo();
         boolean first = true;
         while (suffixResource.getParent() != null) {
             String suffix = suffixResource.getPath();