Skip to content

Commit 54053b8

Browse files
ChristopherDosinjackmcdade
authored andcommitted
Updated menu docs for child elements (#435)
1 parent c39415a commit 54053b8

File tree

1 file changed

+17
-0
lines changed
  • content/collections/tags

1 file changed

+17
-0
lines changed

content/collections/tags/nav.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,23 @@ The `{{ *recursive children* }}` tag will repeat the contents of the entire `{{
161161

162162
It’s an admittedly weird concept, and might take some fiddling with to truly understand, but is very powerful when fully understood. Take the time. Learn to wield it. A powerful Jedi will you be.
163163

164+
## Children {#children}
165+
166+
If you want to take more control over your child menu, you can just loop through the `children` array within your menu, instead of repeating the contents of the child elements with `{{ *recursive children* }}`.
167+
168+
```
169+
{{ if is_current || is_parent }}
170+
{{ if children }}
171+
<ul>
172+
{{ children }}
173+
<li><a href="{{ url }}">{{ title }}</li>
174+
{{ /children }}
175+
</ul>
176+
{{ /if }}
177+
{{ /if }}
178+
```
179+
180+
164181
## Hidden Pages {#hidden-pages}
165182

166183
A common use-case for navigation is to make some pages "hidden", which means to hide them from the nav, but keep them

0 commit comments

Comments
 (0)