Skip to content

Commit

Permalink
Clarify Name and Title menu entry methods
Browse files Browse the repository at this point in the history
  • Loading branch information
jmooring authored Dec 18, 2024
1 parent bce733c commit 32cc191
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
4 changes: 2 additions & 2 deletions content/en/methods/menu-entry/Name.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ action:
signatures: [MENUENTRY.Name]
---

If you define the menu entry [automatically], the `Name` method returns the pages [`LinkTitle`], falling back to its [`Title`].
If you define the menu entry [automatically], the `Name` method returns the page's [`LinkTitle`], falling back to its [`Title`].

If you define the menu entry [in front matter] or [in site configuration], the `Name` method returns the `name` property, falling back to the page’s `LinkTitle`, then to its `Title`.
If you define the menu entry [in front matter] or [in site configuration], the `Name` method returns the `name` property of the given menu entry. If the `name` is not defined, and the menu entry resolves to a page, the `Name` returns the page [`LinkTitle`], falling back to its [`Title`].

[`LinkTitle`]: /methods/page/linktitle/
[`Title`]: /methods/page/title/
Expand Down
10 changes: 2 additions & 8 deletions content/en/methods/menu-entry/Title.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,14 @@ action:
signatures: [MENUENTRY.Title]
---

If you define the menu entry [automatically], the `Title` method returns the page’s [`LinkTitle`], falling back to its [`Title`].
The `Title` method returns the `title` property of the given menu entry. If the `title` is not defined, and the menu entry resolves to a page, the `Title` returns the page [`Title`].

If you define the menu entry [in front matter] or [in site configuration], the `Title` method returns the `title` property, falling back to the page’s `LinkTitle`, then to its `Title`.

[`LinkTitle`]: /methods/page/linktitle/
[`Title`]: /methods/page/title/
[automatically]: /content-management/menus/#define-automatically
[in front matter]: /content-management/menus/#define-in-front-matter
[in site configuration]: /content-management/menus/#define-in-site-configuration

```go-html-template
<ul>
{{ range .Site.Menus.main }}
<li><a href="{{ .URL }}">{{ .Title }}</a></li>
<li><a href="{{ .URL }}" title="{{ .Title }}>{{ .Name }}</a></li>
{{ end }}
</ul>
```

0 comments on commit 32cc191

Please sign in to comment.