[TYPO3-german] Extension Entwicklung Template Einbinden

Fabian Koenig koenig at bluhouse.de
Tue Apr 10 09:23:46 CEST 2007


Immerwieder gern. :-)


Tobias Sasse schrieb:
> Super so funktioniert es :), bin dir sehr Dankbar.
> 
> Schönen Tag noch und freundlichen Gruß
> Tobias
> 
> Fabian Koenig schrieb:
>> Hi!
>>
>> Als erstes versuch es am besten mal mit dem Template:
>>
>> ==HTML:Template==
>> <!-- ###TEMPLATE### begin -->
>>    <table>
>>      <!-- ###CONTENT### begin-->
>>        <!-- ###LIST_ITEM### begin -->
>>          <tr>
>>            <td>###VALUE_NR###</td>
>>            <td>###VALUE_NAME###</td>
>>            <td>###VALUE_DESCRIPTION###</td>
>>            <td>###VALUE_ACTION###</td>
>>          </tr>
>>        <!-- ###LIST_ITEM### end -->
>>      <!-- ###CONTENT### end-->
>>    </table>
>> <!-- ###TEMPLATE### end -->
>> ==HTML:Template==
>>
>> Und mit folgendem script:
>>
>> ==PHP==
>> $this->templateCode = 
>> $this->cObj->fileResource($this->conf['templateFile']);
>>
>> $template['template'] = 
>> $this->cObj->getSubpart($this->templateCode,'###TEMPLATE###');
>> $template['listItem'] = 
>> $this->cObj->getSubpart($template['template'],'###LIST_ITEM###');
>>
>>
>> // Hier kommt deine Datenbankabfrage rein.
>> // Beispiel: $res = 
>> $GLOBALS['TYPO3_DB']->exec_SELECTquery($fieldList,$table,$whereClause,$groupBy,$orderBy,$limit); 
>>
>> $res = ...
>>
>>
>> while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
>>   $markerArray['###VALUE_NR###'] = $row['nr'];
>>   $markerArray['###VALUE_NAME###'] = $row['name'];
>>   $markerArray['###VALUE_DESCRIPTION###'] = $row['description'];
>>   $markerArray['###VALUE_ACTION###'] = $row['action'];
>>   $content_item .= 
>> $this->cObj->substituteMarkerArrayCached($template['listItem'], 
>> $markerArray);
>> }
>>
>> $subpartArray['###CONTENT###'] = $content_item;
>>
>> $content = 
>> $this->cObj->substituteMarkerArrayCached($template['template'], 
>> array(), $subpartArray);
>> return $content;
>> ==PHP==
>>
>>
>>
>> Hoffe es hilft.
>> Wenn nicht -> Weiter fragen ^^
>> $GLOBALS['TYPO3_DB']->MfG('Fabian König');
>>
>>
>>
>>
>> Tobias Sasse schrieb:
>>  
>>> Hallo zusammen,
>>>
>>> habe gerade mittel großes verständis Problem:
>>>
>>> Möchte eine Extension entwickeln und stecke nun beim Einbinden des 
>>> HTML Templates:
>>>
>>> Also es geht um die Ausgabe einer Liste die in etwa so aussehen sollte:
>>>
>>> Name  |  Beschreibung   |  Aktion
>>> ----------------------------------
>>> Hans   |   Neter Kerl      | Anschauen
>>> Peter   |   Guter Läufer   | Anschauen
>>>
>>>
>>> usw.
>>>
>>> mein Template sieht wie folgt aus:
>>>
>>> <!-- ###CONTENT### begin-->
>>>    <table>
>>>        <tr>
>>>            <td>###LABEL_NR###</td>
>>>            <td>###LABEL_NAME###</td>
>>>            <td>###LABEL_DESCRIPTION###</td>
>>>            <td>###LABEL_ACTION###</td>
>>>        </tr>
>>>    <!-- ###LIST_ITEM### begin -->
>>>            <tr>
>>>                <td>###VALUE_NR###</td>
>>>                <td>###VALUE_NAME###</td>
>>>                <td>###VALUE_DESCRIPTION###</td>
>>>                <td>###VALUE_ACTION###</td>
>>>            </tr>
>>>              <!-- ###LIST_ITEM### end -->
>>>    </table>
>>> <!-- ###CONTENT### end-->
>>>
>>> Jetzt bekomme ich es nicht hin das die Marker richtig ersetzt werden, 
>>> kann mir da wohl wer helfen?!?
>>>
>>> http://wiki.typo3.org/index.php/Extension_Development,_using_HTML-Templates 
>>>
>>>
>>> Habe mit hilfe dieser Anleitung nen Ansatz ausprobiert und verstricke 
>>> mich irgendwie immer wieder :(.
>>>
>>> Mit freundlichen Grüßen
>>> Tobias
>>>
>>>     
>>
>>
>> _______________________________________________
>> TYPO3-german mailing list
>> TYPO3-german at lists.netfielders.de
>> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-german
>>
>>   
> 


More information about the TYPO3-german mailing list