aboutsummaryrefslogtreecommitdiffhomepage
path: root/docs/content/en/methods/menu-entry/Menu.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/content/en/methods/menu-entry/Menu.md')
-rw-r--r--docs/content/en/methods/menu-entry/Menu.md24
1 files changed, 24 insertions, 0 deletions
diff --git a/docs/content/en/methods/menu-entry/Menu.md b/docs/content/en/methods/menu-entry/Menu.md
new file mode 100644
index 000000000..6827519bd
--- /dev/null
+++ b/docs/content/en/methods/menu-entry/Menu.md
@@ -0,0 +1,24 @@
+---
+title: Menu
+description: Returns the identifier of the menu that contains the given menu entry.
+categories: []
+keywords: []
+action:
+ related:
+ - methods/page/IsMenuCurrent
+ - methods/page/HasMenuCurrent
+ returnType: string
+ signatures: [MENUENTRY.Menu]
+---
+
+```go-html-template
+{{ range .Site.Menus.main }}
+ {{ .Menu }} → main
+{{ end }}
+```
+
+Use this method with the [`IsMenuCurrent`] and [`HasMenuCurrent`] methods on a `Page` object to set "active" and "ancestor" classes on a rendered entry. See [this example].
+
+[`HasMenuCurrent`]: /methods/page/hasmenucurrent
+[`IsMenuCurrent`]: /methods/page/ismenucurrent
+[this example]: /templates/menu-templates/#example