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

Make HasMenuCurrent return true for $sectionMenuEntry.IsAncestor($pageMenuEntry) #8776

Closed
bep opened this issue Jul 20, 2021 · 0 comments
Closed
Assignees
Milestone

Comments

@bep
Copy link
Member

@bep bep commented Jul 20, 2021

We currently have the sectionPagesMenu setting which in a roundabout way does the above, but it's rather clumsy and I suspect added before we got a proper data structure in this area. For one thing, it makes it hard for themes to make it working out-of-the-box.

I think we can retire that setting by being a little bit smarter about it, that is:

  • We always try the very best to attach a page to a menu item (even if defined in config.toml)
  • For menu entries that is defined for a section, any page below that section will (by default, I'll think of a way to turn it off), return true for HasMenuCurrent.
@bep bep added this to the v0.86 milestone Jul 20, 2021
@bep bep self-assigned this Jul 20, 2021
bep added a commit to bep/hugo that referenced this issue Jul 20, 2021
bep added a commit to bep/hugo that referenced this issue Jul 20, 2021
@bep bep closed this in d831d2f Jul 20, 2021
bep added a commit that referenced this issue Jul 21, 2021
 In Hugo #8776 we added `pageRef`, a way to connect menu items in site config to pages.

This means that you now can have both a Page and a configured URL.

Having the configured URL as a fallback if the Page isn't found is obviously more useful, especially in multilingual sites.

See #8776
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant