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

Document how to filter the navigation #1581

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions content/collections/tags/nav.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ parameters:
type: array
description: >
Limits the fields that will be made available to the tag. Selecting fewer fields will improve performance. By default all variables will be selected. See [performance](#performance).
-
name: '[condition parameters]'
type: 'arbitrary'
description: >
Pro Tip: You can also apply [conditions][1]
to the navigation tree! For example, try things
like `{{ nav hide_from_navigation:isnt="true" }}`.
variables:
-
name: is_published
Expand Down Expand Up @@ -325,3 +332,5 @@ You may improve performance of the `nav` tag in two ways:
If you only need one level, set `max_depth="1"`.
2. Select the fields that you'll be using.
If you're only going to be using `{{ title }}` and `{{ url }}` in the loop, set `select="title|url"`.

[1]: https://statamic.dev/conditions