[TYPO3-english] Problem with generating template

Dawid Pacholczyk dpacholczyk at gmail.com
Thu Jun 3 18:10:12 CEST 2010


Hi, thanks for reply

That was one of the first thing that I did after the problem ocured.
But whe I change it title and the opening and closing <div> isn`t
rendered at all

Best regards,
Dawid Pacholczyk

2010/6/3 Loek Hilgersom <hilgersom at xs4all.nl>:
> Hi Dawid,
>
> It looks like $templateName has the value 'SUBPART1' now, and that subpart
> includes the title, so it will be rendered for every record. If you change
> it to 'SUBPART2' you should be alright.
>
> Hth,
> Loek
>
> On 2010-06-03 11:36, Dawid Pacholczyk wrote:
>>
>> Hi List,
>>  I have small problem in my ext.
>>
>> At the moment I have template like this
>>
>> <!-- ###SUBPART1### -->
>> <div>
>> <h1>Title</h1>
>> <!-- ###SUBPART2### -->
>> ###CONTENT###
>> <!-- ###SUBPART2### -->
>> </div>
>> <!-- ###SUBPART1### -->
>>
>>
>> The php code to generate this template:
>> $templateCode = $this->cObj->fileResource($this->templateFile);
>> $template = $this->cObj->getSubpart($templateCode,
>> '###'.$templateName.'###');
>>                while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
>>                        $markerArray['###CONTENT###'] = $row['content'];
>>                        $content .=
>> $this->cObj->substituteMarkerArray($template, $markerArray);
>>                }
>>
>> The problem is ofc that the Title is generating every time in loop (to
>> get more info I`ll say that this ext should provide list of records
>> (###CONTENT###) with one title)
>>
>> And now. I`m guesing that I miss 1 more subpart in my template to
>> display Title just one time and the records in loop. But I don` know
>> how to write the code for it. Can you give me some info how to do it ?
>>
>> Best regards,
>> Dawid Pacholczyk
>>
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english
>



-- 
Dawid Pacholczyk
tel: 502-054-334
gg: 5564051
skype: dpacholczyk
http://typo3blog.pl (only polish version at the moment)


More information about the TYPO3-english mailing list