Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
This may be me but I create a menu as normal. The active link works fine on all items except when one links to the home page. So if I create a link called "Home" pointing to "" it works but there is no "active" class on the
Comments
Comment #2
markhalliwellUse
<front>
instead of""
.Comment #3
nickbits CreditAttribution: nickbits as a volunteer commentedHi Mark,
Sorry didn't spot that in my original post - should have said
So if I create a link called "Home" pointing to "
<front>
" it works but there is no "active" class on the LI. I have tried other variations but anything linking to the home page doesn't get an active class on the LI. Any other menu item/page is fine. First major project on the D8 version so may be me missing something! But afraid it is not working for me.Comment #4
markhalliwellI did a little digging (by searching for other issues) and determined that this is actually a flaw of core itself #1578832: Class active-trail not added to li element when linking to front page.
However, you may be able to fix it using https://www.drupal.org/project/menu_trail_by_path