Replies: 1 comment
-
That looks fine to me! This seems unique in that you want to show the siblings, not the children? If you're on Node 1, technically the children of that current page are Node 1-1, 1-2, 1-3, and 1-4. But instead, when on Node 1-1 you want to view the siblings of that page. In that case, there's no way around the approach you're doing here where you need to bubble up to the parent to get the children (siblings) to eager-load. I was going to suggest querying the siblings:
But that will produce incorrect results when you're at the top-level - it'll report back the Node 2, etc nodes. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We have the following navigation structure, as seen in the documention on Eager-Loading:
Now, on each page of the second level, we would like to include a subnavigation. Including all nodes of that level.
So the result on each page should be:
Node 1: No subnavigation.
Node 1-1, 1-2, 1-3, and 1-4:
Node 2: No subnavigation
Node 3: No subnavigation
Node 3-1, 3-2, and 3-3:
I have it working with the following queries in my template:
But I was wondering if there would be an easier way to accomplish this.
Or, if there would be a way to optimize those queries.
Any suggestions or ideas are welcome.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions