adobe / adobe/aem-core-wcm-components

[Architecture] Consistent and customizable site root detection

Open
#62 4 comments 1 reaction 0 assignees View on GitHub
enhancement requires new version
Dominant language
Java
Stars
795
Forks
775
Avg merge
3d 22h
Merged PRs (30d)
8

Description

the core components currently implement different (and insufficient) site root detection strategies:
* Breadcrumb and Search (Sandbox) component use a "start level" parameter addressing an absolute parent page
* Navigation (Sandbox) and Language Navigation (Sandbox) provide a root path picker

only providing a "start level" parameter is limiting, because when set in the editable template for a structure element it requires all sites starting at the same level. this is not necessarily the case for more complex site setups.

defining the root level as path is even more inflexible - if defined in the template for the structure component this template can only use for exactly one site. if the navigation component is defined as editable in page, the path has to be entered for every page of the site again.

what is required is a strategy to detect the site root which is configured once, and used for all components the same way that requires a site root (and this strategy should be usable for custom components as well).

ACS AEM Commons implements such a feature, but it is insufficient as well because it is not possible to configure different strategies for different tenants or contant areas, and not possible to customize the site root lookup beyond using a regex: https://github.com/Adobe-Consulting-Services/acs-aem-commons/issues/1037

If the Site Root detection would be implemented as an OSGi service it would be possible to provide own strategies (should support multiple strategies to be tenant-aware). Another option is to use Sling Context-Aware Configuration to either lookup the configuration for a site, or directly use the "inner-most" Context-Aware Configuration context path as site root (this is the default strategy used by [wcm.io URL Handler](http://wcm.io/handler/url/).

Contributor guide

Open the contributing guide

Research direction

Start by comparing site-root handling in the Breadcrumb, Search, Navigation, and Language Navigation Sandbox components. Read the linked ACS AEM Commons issue and evaluate the proposed OSGi service and Sling Context-Aware Configuration approaches. Done means one configurable, reusable root-detection strategy that supports multiple tenants and custom components.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.