Skip to content Skip to footer navigation

Children Tag

The Children tag allows you to loop over and fetch data from the current URL.

Overview#

Warning!

Not to be confused with the children variable when inside the Nav tag.

A troll pointing a teaching stick

The children tag allows you to fetch data and loop over the children of the current page/URL. Can be handy when building a sub-nav, for example.

You can get the parent by using the Parent tag.

Example#

{{ children }}
{{ title }}
{{ /children }}
<statamic:children>
{{ $title }}
</statamic:children>

Fetching children of another entry#

Pass a URL to the of parameter to fetch children from somewhere other than the current page.

{{ children of="/blog" }}
{{ title }}
{{ /children }}
<statamic:children of="/blog">
{{ $title }}
</statamic:children>

Parameters

of

string

The URL of the entry whose children you want to fetch. Defaults to the current URL.