[TYPO3-german] Template mit Subpart
Christian Hensel
christian.hensel at gmx.net
Sat Jun 16 23:23:09 CEST 2007
Hallo Liste bin nach folgendem Beispiel (
http://wiki.typo3.org/index.php/Extension_Development,_using_HTML-Templates
) vorgegangen und habe noch eine Frage:
Ist mein mit //frage markierte Bereich richtig? oder wie muss meine $res
aussehen? So erscheint momentan nichts, ohne subparts, funktioniert es
Ext. Code:
/Start//
$content = '';
# Get the template
$this->templateCode =
$this->cObj->fileResource('typo3conf/ext/cevi_user_enabler/enable.html');
$template['total'] =
$this->cObj->getSubpart($this->templateCode,'###ENABLE###');
$template['item'] =
$this->cObj->getSubpart($this->templateCode,'###ITEM###');
//frage
$query = "SELECT * FROM be_users";
$res = mysql(TYPO3_db,$query);
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
# Build content from template
$markerArray['###name###'] = $row['realName'];
$content_item .=
$this->cObj->substituteMarkerArrayCached($template['item'], $markerArray);
} */
$subpartArray['###USER###'] = $content_item;
$content = $this->cObj->substituteMarkerArrayCached($template['total'],
array(), $subpartArray);
*/
return $content;
Template:
<!-- ###ENABLE### begin -->
<div class="bodytext">
<table border="0">
<tr>
<td> </td>
<td>Benutzername:</td>
<td>Name:</td>
<td>E-Mail Adresse:</td>
<td> </td>
</tr>
<!-- ###USER### -->
<!-- ###ITEM### -->
<tr>
<td>###icon###</td>
<td>###username###</td>
<td>###name###</td>
<td>###e-mail###</td>
<td>###edit###</td>
</tr>
<!-- ###ITEM### -->
<!-- ###USER### -->
</table></div>
<!-- ###ENABLE### end -->
More information about the TYPO3-german
mailing list