Hallo zusammen,
ich bin im bereich PHP ein ziemlicher Anfänger und plane die Ausgabe
einer eigenen Extension über ein Template...
Irgendwas wichtiges habe ich wohl übersehen (bzw. falsch gemacht)
es ergibt keinerlei Ausgabe...
ich hoffe es kann mir jemand helfen...
hier mein Template und die Ausgabe der Extension
(beides stark reduziert für die Übersichtlichkeit)
______________________________________________________________
<!-- TEMPLATE -->
<div id="">
<div class="subcolumns">
<!-- PART1 -->
<div class="c33l">
HTML und diverse Marker
<!-- PART1_ROWS -->
<!-- PART1_ITEM -->HTML und diverse Marker<-- PART1_ITEM -->
<!-- PART1_ROWS -->
</div>
<!-- PART1 -->
<!-- PART2 -->...entsprechend PART1...<!-- PART2 -->
<!-- PART3 -->...entsprechend PART1...<!-- PART3 -->
</div>
<div>HTML und diverse Marker</div>
</div>
<!-- TEMPLATE -->
_______________________________________________________________
<?php
function main($content,$conf) {
...diverse Standard Vorbelegungen
$this->templateCode = $this->cObj->fileResource($conf['templateFile']);
$template['total'] =
$this->cObj->getSubpart($this->templateCode,'###TEMPLATE###');
$this->part1();
$this->part2();
$this->part2();
$content =
$this->cObj->substituteMarkerArrayCached($template['total'], array(),
$subpartArray);
return $this->pi_wrapInBaseClass($content);
}
function part1() {
$template['part1'] =
$this->cObj->getSubpart($template['total'],'###PART1###');
# obere Reihe
$res=$GLOBALS['TYPO3_DB']->exec_SELECTquery("query für einen
Datensatz");
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$markerArray['###mymarker1oben1###'] = $row['xxx1'];
...und weitere
}
#untere Reihen
$template['part1item'] =
$this->cObj->getSubpart($template['goldpart'],'###PART1_ITEM###');
$res=$GLOBALS['TYPO3_DB']->exec_SELECTquery("query für die
restlichen Datensätze für diesen Part");
while($row=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$markerArray['###mymarker1unten1###'] = $row['xxx2'];
...und weitere
$items1 .=
$this->cObj->substituteMarkerArrayCached($template['part1item'],$markerArray);
}
$subpartArray['###PART1_ROWS###'] = $items1;
return
$this->cObj->substituteMarkerArrayCached($template['part1'],$markerArray);
}
function part2() {
...alles entsprechend part1
}
function part3() {
...alles entsprechend part1
}
?>
_________________________________________________________________
--
Ralf-René Schröder
http://if-20.com ... YAML templates for TYPO3
______________________________________________
_______________________________________________
TYPO3-german mailing list
TYPO3-german@lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-german