Skip to content

Fix Home active state on front page (closes #768)#769

Open
drale1 wants to merge 1 commit into8.xfrom
Drale1/8.x/#768-Home-menu-item-does-not-get-active-state-on-front-page-in-Drupal-10
Open

Fix Home active state on front page (closes #768)#769
drale1 wants to merge 1 commit into8.xfrom
Drale1/8.x/#768-Home-menu-item-does-not-get-active-state-on-front-page-in-Drupal-10

Conversation

@drale1
Copy link
Collaborator

@drale1 drale1 commented Feb 13, 2026

Linked issues

Solution

Fixes Home menu item not receiving active state on front page in Drupal 10.
Problem: When the front page is set to a node path (e.g., /node/1), the Home menu item (pointing to /) was not marked as active because the path comparison (/node/1 vs /) failed.
Fix: Added a front page check in the menu active trail detection logic. When on the front page, menu items pointing to / are now correctly marked as active, matching the behavior of other menu items.
This ensures consistent navigation styling across all menu items, including Home, when users are on the homepage.
Testing: Verified on Drupal 10.6.2. Works correctly in Drupal 11 (no changes needed there).

Checklist

  • I have read the CONTRIBUTING.md document.
  • My commit messages follow the contributing standards and style of this project.
  • My code follows the coding standards and style of this project.
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Need to run update.php after code changes
  • Requires a change to end-user documentation.
  • Requires a change to developer documentation.
  • Requires a change to QA tests.
  • Requires a new QA test.
  • I have updated the documentation accordingly.
  • All new and existing tests passed.

@drale1 drale1 requested a review from jjroelofs February 13, 2026 11:48
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

Successfully merging this pull request may close these issues.

1 participant