<?php foreach($page->positions()->toStructure() as $group): ?>
<?= $group->position() ?>
<?php if ($page->hasChildren()): ?>
<?php foreach($page->children()->listed() as $item): ?>
<!-- TEAM MEMBER CONTENT -->
<?php endforeach ?>
<? endif ?>
<? endforeach ?>
I want to show team members, grouped by positions. These positions are created in parent blueptint “People” and then displayed as query in children blueprints. So there is a list of positions in parent, and then for each team member I can select position from that list.
Perfect, thank you! One more thing, this way the groups take order depending how children are sorted. Is it possible to first sort by groups? In my case it is structure field in parent blueprint.