For some reason this isnt working correctly... if i take out the second foreach, I get all the 'groupkeys'... but the way it is currently, I get one groupkey and than the second foreach lists all 'keys' and 'items' for every 'groupkey' under the one..
foreach(array_keys($s) as $groupKey) {
$template->setCurrentBlock("SPACE");
$template->setVariable("SPACEID", $groupKey);
foreach($s[$groupKey] as $key=>$item) {
$template->setCurrentBlock("DETAILHEADER");
$template->setVariable("KEY", $key);
$template->parseCurrentBlock("DETAILHEADER");
$template->setCurrentBlock("DETAILVALUE");
$template->setVariable("VALUE", $item);
$template->parseCurrentBlock("DETAILVALUE");
}
$template->parseCurrentBlock("SPACE");
}
<!-- BEGIN SPACE -->
<table width="961" border="0">
<tr class="header">
<td class="header">{SPACEID}</td>
</tr>
</table>
<table width="961" border="0">
<tr>
<!-- BEGIN DETAILHEADER -->
<td class="sub1">{KEY}</td>
<!-- END DETAILHEADER -->
</tr>
<tr>
<!-- BEGIN DETAILVALUE -->
<td class="sub2">{VALUE}</td>
<!-- END DETAILVALUE -->
</tr>
</table>
<!-- END SPACE -->