Zum Inhalt springen

Datensätze richtig inTempaltes einfügen ich raffs nicht

Erstellt am 8. August 2006 · 2 Antworten · letzte Antwort am 8. August 2006

Tags: Templates & Layouts, PHP, Frage

typonewbe ·

Hallo

Meine Templates sahen bis jetzt immer so aus das ich die Tabelle im Template hatte und nur die Datensätze hinzugefügt werden mussten. das habe ich geschnallt jetzt habe ich aber das Problem das es für jede Personengruppe eine Tabelle braucht mein ansatz war

Template
<!-- ###PERSONNACHGRUPPE### begin -->
<!-- ###GRUPPE### begin -->
<table>
<th><tdcolspan="2">###DIEGRUPPE###</td></th>
<!-- ###PERSONEN### begin -->
<tr><td>Vorname</td><td>Nachname</td></tr>
<tr>
<td>###FIRSTNAME###</td>
<td>###SURNAME###</td>
</tr>
<!-- ###PERSONEN### end -->
</table>
<!-- ###GRUPPE### end-->
<!-- ###PERSONNACHGRUPPE### end -->

mein PHP code sieht so aus

$tmplpath = (string)$this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'fileinput', 'sDef');
			$tmpl = $this->cObj->fileResource($tmplpath?'uploads/tx_fhlstaff/' . $tmplpath:$this->conf['fileinput']);
			$tmpl = $this->cObj->fileResource($tmplpath?'uploads/tx_fhlstaff/' . $tmplpath:$this->conf['fileinput']);
			$tmpl = $this->cObj->getSubpart($tmpl, '###PERSONNACHGRUPPE###');
			$tmpl_table = $this->cObj->getSubpart($tmpl, '###GRUPPE###');

			
			$str ='';
			for($i = 0; $i < count($status_array); $i++)#3
			{
				
				$tmpl_daten = $this->cObj->getSubpart($tmpl_table, '###PERSONEN###');			 
				for($j = 0; $j < count($status_array[$this->sindex[$i]['uid']]); $j++) {
					
					$marker_daten['###FIRSTNAME###'] = $status_array[$this->sindex[$i]['uid']][$j][1];
					$marker_daten['###SURNAME###'] = $status_array[$this->sindex[$i]['uid']][$j][2];
										$str .= $this->cObj->substituteMarkerArrayCached($tmpl_daten, $marker);
				}
				$str = $this->cObj->substituteSubpart($tmpl_table, '###PERSONEN###', $str);
				$marker_table['###DIEGRUPPE###'] = $this->sindex[$i]['notation'];
				$str .=$this->cObj->substituteMarkerArrayCached($tmpl_table, $marker_table);
				
			}
			 $str = $this->cObj->substituteSubpart($tmpl, '###GRUPPE###', $str);
			 
			//$str = $this->cObj->substituteSubpart($tmpl,'###PERSONEN###',$str);
			
return $str;

Aber irgendwie haut das alles nicht hin es werden immer nur die marker ausgegeben ohne Inhalt.

Kann mir jemand helfen
oder nen tutorial zeigen was diese Verschachtelung behandelt

Danke schon mal im Voraus

just2b ·

Hallo,

hab mal den Thread verschoben, mit TYPOSCRIPT hat das ganze ja nun wirklich nix zu tun!

siehe > #41613 > HTML-Templates einbinden:

georg