How to get children of a specific child (and sorted)

My folder looks like:

content
    1-Home
    2-Team
        groupA
            Chef
                1-Elon Musk
            Employee
                1-Alice
                2-Bob
            Trainee
                1-Charlie
        groupB
        groupC
    3-Contact

In The Team-Page template I want to display all Employees of a specific group as a dynamic list. How do I get them and sorted by the number?
I have something working which gives me all, the chef, employees and trainees:

$team = $page->find('groupA', 'Employee')->children()->children();
foreach($team as $name):
    echo $name;
endforeach;
$group = 'groupA';
$team = page('team/' . $group . '/Employee')->children();

BTW: It is recommended to use lowercase page UIDs so that your site works reliably on case-sensitive file systems.

GREAT - thanks that works. But why is page(β€˜team/’ . $group . β€˜/Employee’) not with a $ ??

will use lowercase page UIDs now.

Because that is a helper function: https://getkirby.com/docs/cheatsheet#helpers

BTW: The find() method only works with collections, not with a single page.

1 Like