assign("title","Council"); $page->assign("full",false); $page->assign("info","council.tpl"); $page->assign("title","Council"); // store each record in an array $R - use the template to loop over the array $isCouncillor = false; foreach ($council as $name => $position) { if (!$isCouncillor && !strcasecmp($name,"Councillors")) { $isCouncillor = true; continue; } $P = new Record ($name); if ($isCouncillor) { $P->record["post"] = ($position?" - ":"").strtoupper($position); $Councillors = array_merge ($Councillors,array($P->record)); } else { $P->record["pre"] = strtoupper($position)." - "; $Officers = array_merge ($Officers,array($P->record)); } } $page->assign("Officers",$Officers); $page->assign("Councillors",$Councillors); $page->display("front.tpl"); ?>