Hallo Ich habe ein kleines Problem, wo ich nicht weiter komme...
Und zwar habe ich Termine, die In Kategorien ausgegeben werden sollen. In der ersten foreach-Schleife setze ich die Marker für die Kategorien:
$marker = array(
'###HISTORY_TERMINHEADLINE###' => $this->cObj->crop($name,'20 | ...'),
'###DATE###' => '',
'###CITY###' => '',
'###LOCATION###' => '',
);
$subpart = $this->cObj->getSubPart($template['total'], '###HISTORY_CONTENT###');
$content .= $this->cObj->substituteMarkerArrayCached($subpart, $marker);
... und in der zweiten die dazugehörigen Termine:
foreach($items as $item)
{
$marker_items = array(
'###DATE###' => date('d.m.Y',$item['date']),
'###CITY###' => $item['city'],
'###LOCATION###' => $item['location'],
);
//echo t3lib_div::debug($items);exit;
$subpart2 = $this->cObj->getSubPart($subpart, '###HISTORY_ITEMS###');
$content .= $this->cObj->substituteMarkerArrayCached($subpart2, $marker_items);
//echo $content;exit;
}
so weit, so gut...
Am Ende kopiere ich noch alles in den Subpart ###OUTPUTLIST### und lösche den ###HISTORY_CONTENT### Marker:
$subpartArray['###OUTPUTLIST###'] = $content;
$subpartArray['###HISTORY_CONTENT###'] = '';
$content = $this->cObj->substituteMarkerArrayCached($template['total'], array(),$subpartArray);
Hier das HTML-Template:
<!-- ###TEMPLATE_HISTORY### -->
###OUTPUTLIST###
<!-- ###HISTORY_CONTENT### -->
<h2>###HISTORY_TERMINHEADLINE###</h2>
<table id="table" cellpadding="0" cellspacing="0" style="width: 100%">
<!-- ###HISTORY_ITEMS### begin -->
<tr>
<td>###DATE###</td> <td>###CITY###</td> <td>###LOCATION###</td>
</tr>
<!-- ###HISTORY_ITEMS### end -->
</table>
<!-- ###HISTORY_CONTENT### -->
<!-- ###TEMPLATE_HISTORY### end -->
Die Ausgabe funktioniert auch soweit, nur wird der Inhaltnicht zwischen dem <table> ausgegeben, sondern erst danach:
<table id="table" cellpadding="0" cellspacing="0" style="width: 100%">
<!-- ###HISTORY_ITEMS### begin -->
<tr>
<td></td> <td></td> <td></td>
</tr>
<!-- ###HISTORY_ITEMS### end -->
</table>
<tr>
<td>12.06.2009</td> <td> Teststadt1 </td> <td>Testlocation1</td>
</tr>
<tr>
<td>13.06.2009</td> <td> Teststadt1 </td> <td> Testlocation1 </td>
</tr>
<tr>
<td>25.08.2009</td> <td> Teststadt1 </td> <td> Testlocation1 </td>
</tr>
<tr>
<td>04.09.2009</td> <td> Teststadt1 </td> <td> Testlocation1 </td>
</tr>
Was läuft da schief? Ist letzte substituteMarkerArrayCached eventuell falsch?
Danke für jede Hilfe! 😃
olli