<?php
$team = new Page(79);

$team_cats = [];

if (!empty($team->pagedata['Team'])) {
    foreach ($team->pagedata['Team'] as $k => $member) {
        $cat_name = strtolower(str_replace('-', ' ', $member['Category']['value']));
        $member['Category']['key'] = $member['Category']['value'];
        $member['Category']['value'] = ucwords($cat_name);
        $member['Tab Title']['value'] = $member['Category']['key'];
        $team_cats[$member['Category']['value']][] = $member;
    }
}


$twig->addGlobal('team_cats', $team_cats);
$twig->addGlobal('team', $team);
//$twig->addGlobal('categories', $category_list);

