New: Learn Statamic on Laracasts!

We've retired the forum in favor of GitHub Discussions.

New conversations can be started on GitHub. Existing conversations will remain for a while longer.

Head over to GitHub →

Menu - Get child entries

Christopher July 27, 2019 by Christopher

I have a menu and want to build a "mega menu" and i need an individual layout for the child lists/items.

So if i dump my menu i have a children array with all child pages. Now i want to loop through this childs with

  {{ foreach:children }}
    <a href="{{ url }}">{{ title }}</a>
  {{ /foreach:children }}

But i don't get the children values - With {{ title }} i am getting the title from the parent menu item, not from the child. ( title etc. is of course available inside the children array )

I think i am using maybe the foreach from Statamic wrong?

Answered by Jon!
>>>>>>> Answered <<<<<<<
5 Replies