[TYPO3] HTML template

Rakowski Tomasz raczek at open.infi.pl
Fri Jul 13 16:49:26 CEST 2007


Hello!

I have the following problem:

I am creating ext that will use HTML templates.
The basic role of this ext is to display the images in rows and you can 
specify the number of pictures in the row (so in other words you can 
specify the number of columns).
I want to build it using tables (<tr> <td>).

I divided template into some parts.
But the most crucial thing is the logic of this subpart stuff.
How to create a template or write a code that would enable me after 
reaching 3 fotos to start a new <tr> row?
Because now I have sth like this:

<!-- ###SUB_TEMPLATE_ITEMS### begin -->

<table>

<tr>###ITEMS###</tr>

</table>

<!-- ###SUB_TEMPLATE_ITEMS### end -->


  	<!-- ###SUB_TEMPLATE_ITEM### begin -->
	
	<td >###FOTO###</td>
	
	
	<!-- ###SUB_TEMPLATE_ITEM### end -->



and it is impossible.

My PHP code works like that:


first funtion realisationsView() gets the template parts
and calls listing fuction:
$markerArray['ITEMS']=$this->listImages();

listImages() queries the DB and on every record it calls another 
function that will get all data of that particular record:
$tRows[] = $this->imageElement();

imageElement() substitutes the ###FOTO### marker
$markerArray['FOTO'] = 'sth';
and returns it back to parent function

return $this->cObj->substituteMarkerArray($this->rowTplImage, 
$markerArray, '###|###', 0);


I hope you understand my problem.
I would like to check the number of records (in listImages) and than if 
it's greater than some number start a new row <tr>.


thx in advance for any ideas

racco


More information about the TYPO3-english mailing list