Hallo Leute,
ich habe mir eine Extension geschrieben, bzw. bin noch dabei. Das Frontend funktioniert soweit mit der Ausgabe, nur die Form der Ausgabe gefällt mir nicht.
Die Ausgabe der Ergebnisse erfolgt untereinander.
Beispiel:
1 - Nominat
2 - Morph1
3 - Morph2
4 - Morph3
Nun möchte ich diese jedoch so haben, das ich 3 Ergebnisse nebeneinander und das es dann in einer neuen Zeile losgeht.
Beispiel:
1 - Nominat 2 - Morph1 2 - Morph2
4 - Morph3
rein in PHP wüsste ich wie es hinbekommen würde, aber hier bei meiner Extension leider nicht und wollte ich daher um ein paar Tipps bitten. Anbei mal noch die Funktion und das Template, es handelt sich dabei um die 2. while Schleife.
Grüße Marko
function displayAll() {
# Get the parts out of the template
$template = array();
$template['total'] = $this->cObj->getSubpart($this->templateCode,'###TEMPLATE###');
$template['reptile'] = $this->cObj->getSubpart($template['total'],'###REPTILES###');
$query_species = "SELECT * FROM tx_mhreptiles_species";
$res_species = mysql(TYPO3_db,$query_species);
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_species)) {
$content_reptile = '';
$markerArray['###MARKER_SPECIES###'] = $row['species'];
$query_reptiles = "SELECT * FROM tx_mhreptiles_reptiles WHERE species=".$row['uid']." order by species,subspecies";
$res_reptiles = mysql(TYPO3_db,$query_reptiles);
while ($row_reptiles = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_reptiles)) {
$markerArray["###MARKER_SUBSPECIES###"] = $this->getFieldContent('subspecies',$row_reptiles['subspecies']);
$markerArray["###MARKER_REPTILES_NAME###"] = $row_reptiles['name'];
$markerArray["###MARKER_REPTILES_IMAGE###"] = $this->getFieldContent('image',$row_reptiles['image']);
$markerArray["###MARKER_REPTILES_PRICE_FEMALE###"] = $row_reptiles['pricefemale'];
$markerArray["###MARKER_REPTILES_PRICE_MALE###"] = $row_reptiles['pricemale'];
$content_reptile .= $this->cObj->substituteMarkerArrayCached($template['reptile'], $markerArray);
}
$subpartArray['###CONTENT###'] = $content_reptile;
$content .= $this->cObj->substituteMarkerArrayCached($template['total'], $markerArray, $subpartArray, $wrappedSubpartContentArray);
}
return $content;
}
<!-- ###TEMPLATE### begin -->
<table align="center" width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top">
<td align="left"><font face="Tahoma, Verdana, Arial" style="font-size: 11pt; font-weight: bold;">###MARKER_SPECIES###</font></td>
</tr>
<tr>
<td align="left">###MARKER_SUBSPECIES###</td>
</tr>
<!-- ###CONTENT### -->
<!-- ###REPTILES### -->
<tr>
<td align="left" width="25%">
<table align="center" width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top">
<td align="center" colspan="2">###MARKER_REPTILES_NAME###</td>
</tr>
<tr valign="top">
<td align="center" colspan="2">###MARKER_REPTILES_IMAGE###</td>
</tr>
<tr valign="top">
<td align="left" width="50%">Preis Weibchen:</td>
<td align="right" width="50%">###MARKER_REPTILES_PRICE_FEMALE###</td>
</tr>
<tr valign="top">
<td align="left" width="50%">Preis Männchen:</td>
<td align="right" width="50%">###MARKER_REPTILES_PRICE_MALE###</td>
</tr>
</table>
</td>
</tr>
<!-- ###REPTILES### -->
<!-- ###CONTENT### -->
</table>
<!-- ###TEMPLATE### end -->