[TYPO3-german] Probleme mit Templates und der Ausgabe

marko.hoffmann at yes-globushaus.de marko.hoffmann at yes-globushaus.de
Mon Apr 23 10:02:55 CEST 2007


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:

Nominat
Morph1
Morph2
Morph3
...

Nun möchte ich diese jedoch so haben, das ich 3 Ergebnisse nebeneinander und das es dann in einer neuen Zeile losgeht.

Beispiel:

Nominat - Morph1 - Morph2
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

CODE:
function displayAll()	{
	
  $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 WHERE deleted='0' AND hidden='0'";
  $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']." AND deleted='0' AND hidden='0' 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:
<!-- ###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>
<tr>
<!-- ###CONTENT### -->
  <!-- ###REPTILES### -->
  <td align="center" width="25%">
    <table align="center" width="25%" border="0" cellspacing="0" cellpadding="0">
    <tr valign="top">
      <td align="left" colspan="2">###MARKER_REPTILES_NAME###</td>
    </tr>
    <tr valign="top">
	<td align="left" colspan="2">###MARKER_REPTILES_IMAGE###</td>
    </tr>
    <tr valign="top">
	<td align="left" width="75%">Preis Weibchen:</td>
	<td align="right" width="25%">###MARKER_REPTILES_PRICE_FEMALE###</td>
    </tr>
    <tr valign="top">
	<td align="left" width="75%">Preis Männchen:</td>
	<td align="right" width="25%">###MARKER_REPTILES_PRICE_MALE###</td>
    </tr>
    </table>
  </td>
  <!-- ###REPTILES### -->
<!-- ###CONTENT### -->
</tr>
</table>
<br>
<!-- ###TEMPLATE### end --> 




More information about the TYPO3-german mailing list