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

Home link block doesn't use current-menu-item class when on front page #34770

Closed
getdave opened this issue Sep 13, 2021 · 2 comments · Fixed by #51478
Closed

Home link block doesn't use current-menu-item class when on front page #34770

getdave opened this issue Sep 13, 2021 · 2 comments · Fixed by #51478
Assignees
Labels
[Block] Home Link Affects the Home Link Block [Block] Navigation Affects the Navigation Block [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.

Comments

@getdave
Copy link
Contributor

getdave commented Sep 13, 2021

What problem does this address?

When you create a navigation using the core/navigation block you often want to add a link to Home. It's great that we supply a "Home link" block for this purpose.

However, whilst normal Nav Link blocks output a current-menu-item class when you are on that page, the Home link block does not. This makes it impossible to style the current page consistently across the navigation.

Screen Shot 2021-09-13 at 09 22 45

Screen Shot 2021-09-13 at 09 22 03

What is your proposed solution?

The home link block should output the current-menu-item class when you are on that page. It should mirror the same functionality as the core/navigation-link block.

@getdave getdave self-assigned this Sep 13, 2021
@annezazu annezazu added [Type] Enhancement A suggestion for improvement. and removed [Feature] Navigation Screen labels Sep 21, 2022
@mrfoxtalbot
Copy link

This has come up in the support forums a few times, most recently here. There is also an open Trac ticket about it.

If this is relatively easy to fix, I would suggest increasing the priority, @getdave. Thank you!

@getdave getdave added the [Block] Home Link Affects the Home Link Block label Mar 24, 2023
@netm
Copy link

netm commented Jun 9, 2023

I have a related problem I think:

  • 2023 theme with a simple child theme extending it
  • .current-menu-item only exists for 'Home' in menu but is not inserted for other locations
  • Bug can currently be inspected here where you can see no current class is inserted in the li : https://wanakacommunityworkshop.org.nz/wood-workshop/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Home Link Affects the Home Link Block [Block] Navigation Affects the Navigation Block [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.
Projects
Development

Successfully merging a pull request may close this issue.

5 participants