-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
Children Array empty #412
Comments
I don't see any issue on my end I'm afraid, altering your template slightly: {% set nodesMain = craft.navigation.nodes()
.handle('mainMenu')
.with(['children'])
.level(1)
.all() %}
{% nav node in nodesMain %}
- {{ node.url }}<br>
{% for subNode in node.children %}
-- {{ subNode.url }}<br>
{% endfor %}
{% endnav %} Produces a correct hierarchy for me:
Can you share a screenshot of your navigation node builder, in case that's a factor? Does it work without eager-loading the children |
@engram-design Hi Josh, And yes without eager loading everything is back. |
What sort of nodes are they in your navigation? Entries, custom or other? I don't think it'll make a difference, but just checking. |
Mix of Categories, Entries and some custom |
@engram-design Hi Josh, how do we continue with that one here? |
I'm still not able to replicate this behaviour, sorry. I'm not sure how eager-loading could omit the child nodes from the structure output either. If you're up for sending your database to |
Describe the bug
Hi,
some navigations of existing projects are broken. Not sure for how long tbh.
Nodes query:
{% set nodesMain = craft.navigation.nodes()
.handle('mainMenu')
.with(['children'])
.level(1)
.all() %}
{% nav node in nodesMain %}
{% if node.children |length %}
{% endif %}
{% endnav %}
Either in a nav or for loop the childs are not rendered and the childs array is empty.
Childs are rendered when we use:
{% ifchildren %}
{% children %}
{% endifchildren %}But we need a custom part for the childs
Steps to reproduce
Craft CMS version
4.13.7
Plugin version
2.1.1
Multi-site?
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: