hallo,
ich habe für meine extension ein template angelegt. das template wird eine list und single ansicht enthalten, ähnlich wie bei tt_news.
nun frage ich mich, wie das füllen der marker in einer schleife der lsit ansicht funktioniert!?
mein template(list):
<html>
<body>
<!-- ###TEMPLATE_LIST### begin -->
<table border="0" width="98%">
<!-- ###CONTENT_LIST### begin -->
<tr>
<td valign="top">
###IMAGE###
</td>
<td valign="top">
###TITLE###<br>
###BESTNR###<br><br>
###INFOTEXT###
</td>
</tr>
<!-- ###CONTENT_LIST### end -->
</table>
<!-- ###TEMPLATE_LIST### end -->
</body>
</html>
nun soll der inhalt in CONTENT_LIST erscheinen. wier läuft das nun ab? ich lese mein template ein ($this->templateCode = $this->cObj->fileResource($this->conf['templateFile'])😉, dann gebe ich erst den einen subpart an ($template['list'] = $this->cObj->getSubpart($this->templateCode,'###TEMPLATE_LIST###')😉 und dann den weiteren ($template['content_list'] = $this->cObj->getSubpart($this->templateCode,'###CONTENT_LIST###')😉. wie geht es weiter??
erstmal danke für deine antwort....ich habe es nun versucht, bekomme aber garkeine ausgabe.
mein template:
<html>
<body>
<!-- ###TEMPLATE_LIST### begin -->
<table border="0" width="98%">
<!-- ###LIST_ITEM### begin -->
<tr>
<td valign="top">
###IMAGE###
</td>
<td valign="top">
###TITLE###<br>
###BESTNR###
</td>
</tr>
<!-- ###LIST_ITEM### end -->
</table>
<!-- ###TEMPLATE_LIST### end -->
</body>
</html>
mein code:
$this->templateCode = $this->cObj->fileResource('typo3conf/ext/gebrauchtmanager/templates/gebraucht_auto_template.htm');
$this->templates['list'] = $this->cObj->getSubpart($this->templateCode,'###TEMPLATE_LIST###');
$this->template['list_item'] = $this->cObj->getSubpart($template['list'],'###LIST_ITEM###');
[...]
while($row = mysql_fetch_array($res))
{
$markerArray['###IMAGE###'] = $this->getPicture($row2["pic"],"150");
$markerArray['###TITLE###'] = $row["artikelbezeichnung"];
$markerArray['###BESTNR###'] = $row["artnr"];
$content_item .= $this->cObj->substituteMarkerArrayCached($this->template['list_item'], $markerArray);
}
$subpartArray['###list_item###'] = $content_item;
return $this->cObj->substituteMarkerArrayCached($this->template['list'], $markerArray, $subpartArray);
was mache ich falsch - die seite bleibt leer!?
nimm zum verstehn mal die besseren bezeichungen aus dem tut und nicht die von dir, die noch dazu inkonsistent sind (groß, klein)
georg