adobe / aem-core-wcm-components

Standardized components to build websites with AEM.
https://docs.adobe.com/content/help/en/experience-manager-core-components/using/introduction.html
Apache License 2.0
747 stars 753 forks source link

Duplicate breadcrumb items possible with certain configuration #2858

Open ky940819 opened 2 months ago

ky940819 commented 2 months ago

Feature Request

Is your feature request related to a problem? Please describe. Currently, it is possible to create a scenario where duplicate breadcrumb items are shown. The following requirements must be met:

  1. Link shadowing is enabled
  2. A page in the hierarchy of the current page is configured as a redirect to its own parent.

This issue only exists with shadowing turned on, otherwise the breadcrumb title and link would be for the redirect page (not the redirect target page). However, when shadowing is turned on, and a page redirects to it's own parent page, the target page is duplicated in the breadcrumb.

Consider the page hierarchy

The breadcrumb will be like: Home > Home > Page 2

The duplication serves no purpose - it adds no information to the breadcrumb trail. Yes, the second breadcrumb item could be suppressed by hiding the page in navigation; however, the breadcrumb can also be configured to display pages that are hidden in navigation.

Describe the solution you'd like When creating the breadcrumb items, if the Link for a breadcrumb item is equivalent to the Link of the previous breadcrumb item, then the duplicate should be omitted from the results.

Are there alternatives? No

Addition Considerations In my opinion, the side-by-side duplicate items should be prevented; however, it is also possible to create two identical links in the breadcrumbs which aren't adjacent. By this I mean you could create a breadcrumb such as Home > Page 1 > Home > Page 2. Further discussion on if all duplicates (other than the first instance) should be removed, or only adjacent ones.