so. ich habe es mal verständlich umgeschrieben… alles andere wäre verwirrend geworden…
VORAUSSETZUNG ist, dass es die renderingeinstellungen die anzuzeigenden felder auch inne haben!
in meinem fall muss also wildname und wildart in den renderingeinstellungen (MIT grünem AUGE) existieren!!!
wer fragen hat, einfach fragen…
HTML5-Template -> Tabellenausgabe mit Kopf und dazugehörigen ITEMS...
PHP-Code:
<?php $strRendersettings = ($this->settings)? 'settings' : 'view'; ?>
<?php if (count($this->data)): ?>
<?php $wildart = 'NULL' ?>
<?php foreach ($this->data as $arrItem): ?>
<?php if ($wildart == $arrItem['raw']['wildtier_auswahl']['wildart']): ?> <!--VARIABLE wildart istgleich Inhalt im ARRAY-->
<tr>
<td>
<!-- TABELLEN-Inhalt -> wildname-->
</td>
</tr>
<?php elseif ($wildart == 'NULL'): ?> <!--VARIABLE wildart istgleich NULL (betrifft den Anfang der schleife!)-->
<table>
<thead>
<tr>
<th>
<!-- TABELLEN-Kopf -> wildart-->
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<!-- TABELLEN-Inhalt -> wildname-->
</td>
</tr>
<?php $wildart = $arrItem['raw']['wildtier_auswahl']['wildart']; ?> <!--<- wildart-variable setzen-->
<?php else: ?> <!--VARIABLE wildart istUNgleich Inhalt im ARRAY-->
</tbody> <!--<- WICHTIG, BODY und TABLE zu schließen!!!-->
</table> <!--<- WICHTIG, BODY und TABLE zu schließen!!!-->
<table>
<thead>
<tr>
<th>
<!-- TABELLEN-Kopf -> wildart-->
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<!-- TABELLEN-Inhalt -> wildname-->
</td>
</tr>
</tbody>
</table>
<?php $wildart = $arrItem['raw']['wildtier_auswahl']['wildart']; ?> <!--<- wildart-variable setzen-->
<?php endif; ?>
<?php endforeach; ?>
<?php else: ?>
<?php endif; ?>
</tbody> <!--<- WICHTIG, BODY und TABLE zu schließen!!!-->
</table> <!--<- WICHTIG, BODY und TABLE zu schließen!!!-->
Lesezeichen