diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2021-07-20 12:10:22 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2021-07-20 17:50:59 +0200 |
commit | d831d2fce8198fb814ea4d3d8c311db5c388d04c (patch) | |
tree | 6aef026a4941e625e4a23a72644bc70a7d98c292 /docs/content | |
parent | 634481ba8cfcd865ba0d8811d8834f6af45663d7 (diff) |
Simplify "active menu" logic for section menus
Fixes #8776
Diffstat (limited to 'docs/content')
-rw-r--r-- | docs/content/en/functions/hasmenucurrent.md | 2 | ||||
-rw-r--r-- | docs/content/en/variables/menus.md | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/docs/content/en/functions/hasmenucurrent.md b/docs/content/en/functions/hasmenucurrent.md index c7b8eb7a9..c53c91f94 100644 --- a/docs/content/en/functions/hasmenucurrent.md +++ b/docs/content/en/functions/hasmenucurrent.md @@ -24,4 +24,6 @@ aliases: [] returns `true` if the PAGE is the same object as the `.Page` in one of the **children menu entries** under MENUENTRY in a given MENU. +{{< new-in "0.86.0" >}} If MENUENTRY's `.Page` is a [section](/content-management/sections/) then, from Hugo `0.86.0`, this method also returns true for any descendant of that section.. + You can find its example use in [menu templates](/templates/menu-templates/). diff --git a/docs/content/en/variables/menus.md b/docs/content/en/variables/menus.md index d84837a43..9b8fe4d49 100644 --- a/docs/content/en/variables/menus.md +++ b/docs/content/en/variables/menus.md @@ -40,6 +40,9 @@ Reference to the [page object][page-object] associated with the menu entry. This will be non-nil if the menu entry is set via a page's front-matter and not via the site config. +.PageRef {{< new-in "0.86.0" >}} +: _string_ <br /> Can be set if defined in site config and the menu entry refers to a Page. [site.GetPage](/functions/getpage/) will be used to do the page lookup. If this is set, you don't need to set the `URL`. + .Name : _string_ <br /> Name of the menu entry. The `name` key, if set for the menu entry, sets |