Unauthorized menu items displayed in AEM navigation when SDI is enabled

This article explains how a custom navigation component in Adobe Experience Manager (AEM) can display unauthorized menu items when Sling Dynamic Include (SDI) is enabled. The issue occurs when the component relies on the current page path to determine the navigation context at runtime. To resolve the issue, redesign the navigation implementation to use template-specific configuration instead of runtime request context.

Description description

Environment

Adobe Experience Manager (AEM)

Issue/Symptoms

  • A custom navigation component embedded in non-editable template structures and live-copied across restricted and public site sections loses the original page context when SDI is enabled.
  • SDI replaces the navigation component with a stub in the cached page and issues a separate request to render the component.
  • The SDI request does not include the original page URL or path context.
  • The navigation component cannot override its configured Navigation Root value based on the current page path.
  • Navigation intended for restricted users may become visible to public users.
  • Disabling SDI restores the expected navigation behavior but reintroduces the risk of cached navigation exposing restricted content.

Resolution resolution

Follow the steps below to resolve the issue:

  1. Review the custom navigation component implementation and identify any logic that depends on runtime request context, such as the current page path, to determine the Navigation Root property.
  2. Redesign the template structure so that restricted and public navigation contexts use separate templates. Configure the Navigation Root property directly within each template instead of deriving it dynamically at runtime.
  3. Update the navigation component to use the Navigation Root value defined in the template configuration and stop overriding the value based on request context.
  4. Test the navigation component in both restricted and public site sections and confirm that only the appropriate menu items are displayed for each context.
  5. Re-enable SDI and verify that the navigation renders correctly and that unauthorized menu items are not exposed.
  6. If the implementation depends heavily on custom navigation logic, consider engaging your implementation partner for assistance with redesigning the component or template structure.
recommendation-more-help
experience-cloud-kcs-help-kbarticles