Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Language Navigation in Live Copy using incorrect root page #2867

Open
HitmanInWis opened this issue Sep 24, 2024 · 0 comments
Open

Language Navigation in Live Copy using incorrect root page #2867

HitmanInWis opened this issue Sep 24, 2024 · 0 comments

Comments

@HitmanInWis
Copy link

When a Language Navigation component is in a template structure, or in a blueprint XF inherited to a live copy site, the Navigation Root isn't updated to the Live Copy site, and thus the nav links/languages point to the blueprint site rather than the live copy.

Language Navigation should operate similar to the Navigation component, which takes the configured Navigation Root page and updates it to the current site path before calculating nav links.

The update would be made to LanguageNavigationImpl, using similar logic as NavigationImpl, changing:

    public List<NavigationItem> getItems() {
        if (items == null) {
            PageManager pageManager = currentPage.getPageManager();
            rootPage = pageManager.getPage(navigationRoot);
            if (rootPage != null) {

to

    public List<NavigationItem> getItems() {
        if (items == null) {
            PageManager pageManager = currentPage.getPageManager();
            rootPage = pageManager.getPage(navigationRoot);
            rootPage = LocalizationUtils.getLocalPage(rootPage,
                    this.currentPage,
                    this.request.getResourceResolver(),
                    this.languageManager,
                    this.relationshipManager)
                .orElseGet(() -> rootPage);
            if (rootPage != null) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant