Skip to content

[6.x] Add limit and offset parameters to the nav tag - #15777

Merged
duncanmcclean merged 2 commits into
statamic:6.xfrom
mynetx:feat/nav-limit-offset
Nov 3, 2026
Merged

duncanmcclean merged 2 commits into
statamic:6.xfrom
mynetx:feat/nav-limit-offset

Conversation

@mynetx

@mynetx mynetx commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Statamic v2 had limit and offset on the nav tag, and v3+ quietly ignores them. They're handy when you want to split a nav, like putting the logo in the middle of the header:

<nav>{{ nav:main limit="3" }}<a href="{{ url }}">{{ title }}</a>{{ /nav:main }}</nav>
<div class="logo">...</div>
<nav>{{ nav:main offset="3" }}<a href="{{ url }}">{{ title }}</a>{{ /nav:main }}</nav>

This adds both to {{ nav }}, {{ structure }} and {{ children }}. They apply to the top level items only, and the tree is sliced before it gets augmented, so first, last, index and count match what's actually rendered.

Before

before

After

after

Implements statamic/ideas#405

🤖 Generated with Claude Code

@duncanmcclean
duncanmcclean enabled auto-merge (squash) November 3, 2026 10:00
@duncanmcclean
duncanmcclean merged commit b95874d into statamic:6.x Nov 3, 2026
61 checks passed
@mynetx
mynetx deleted the feat/nav-limit-offset branch November 4, 2026 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants