Hi,
I have a breadcrumb component on a page that is 5 levels deep. The pages at levels 2, 3, and 4 are not ready yet, but page on level 5 is ready for go live and we'd like to offer users the ability to see Home > Page on level 5 on the breadcrumb if possible. I have set the page properties for pages on levels 2, 3, 4 to enable 'Hide in navigation', and it seems the breadcrumb can only handle levels 2 and 3 being hidden, but it cannot hide level 4 on the published page. What is really interesting is the author view and preview published view both hide the level 4 page, so the breadcrumb displays Home > Level 5 page. The published page breadcrumb shows Home > level 4 page > level 5 page. Has anyone seen this?
Hi @LaurenDo1,
Before answering to your question I want to understand:
Are you using a custom breadcrumb component or Adobe’s Core Component?
Has the 'Hide in Navigation' setting on the level 4 page been published to the Publish environment?
Also, If it’s a custom or Core Component-based breadcrumb, can you confirm?
if (!currentPage.getProperties().get("hideInNav", false)) {
// include in breadcrumb
}
and make sure this check is happening for each parent level, not just the current or top levels.
Hi @LaurenDo1, could you please confirm the following things:
1. Level 4 page is properly published and replicated and have the property: hideInNav = true in CRXDE of publish (compare the location also with the pages like level 1 or level 2 or level 3)
2. The issue is not due to caching (try clearing dispatcher cache, browser cache)
3. If using a custom breadcrumb component, modify its logic to consistently filter all hidden pages:
while (page != null && !page.isRoot()) {
if (!page.getProperties().get("hideInNav", false)) {
breadcrumb.add(page);
}
page = page.getParent();
}
Hi @LaurenDo1 ,
This happens in custom implementations due to either of:
- hideInNav not replicated to Publish for level 4.
- Custom breadcrumb logic not filtering all parent pages correctly.
- Dispatcher or browser caching.
1. Confirm hideInNav is on Publish
- Go to /crx/de on the Publish instance
- Navigate to:
- /content/<site>/level-1/level-2/level-3/level-4
- Confirm:
- Property: hideInNav = Boolean true
- Last Replicated Date is recent.
If missing, replicate the page from Author again to Publish.
3. Use Correct Breadcrumb Filtering Logic in Code
If you are using a custom breadcrumb component, this is the correct Java logic that works for filtering hideInNav = true pages from breadcrumb:
Java or HTL Sling Model:
List<Page> breadcrumb = new ArrayList<>();
Page current = resourceResolver.resolve(currentPage.getPath()).adaptTo(Page.class);
while (current != null && !current.isRoot()) {
boolean hideInNav = current.getProperties().get("hideInNav", false);
if (!hideInNav) {
breadcrumb.add(0, current); // add in reverse for correct order
}
current = current.getParent();
}
This ensures all levels, including deeply nested ones like level 4, are filtered.
4. If using Core Component Breadcrumb
Out-of-the-box Core Breadcrumb v2/v3 supports hideInNav out of the box.
Check that:
- You're using v2+ of the Core Component.
- In template policy, Show hidden pages = false.
- You can inspect in /conf/<site>/settings/wcm/policies/... or through template edit
Regards,
Amit
Hi @LaurenDo1
Could you please check cache? It might be possible that page is cached somewhere. Try with query paramters.
Here are the details of core breadcrumb component , if you are using same